@@ -3,7 +3,7 @@ import { mount } from "@vue/test-utils";
3
3
import VueEllipseProgress from "@/components/VueEllipseProgress.vue" ;
4
4
import CircleContainer from "@/components/Circle/CircleContainer.vue" ;
5
5
import Counter from "@/components/Counter.vue" ;
6
- import { animationParser , dotParser , dashParser , lineModeParser } from "@/components/optionsParser" ;
6
+ import { animationParser , dotParser , dashParser , lineModeParser , linePositionParser } from "@/components/optionsParser" ;
7
7
import props from "@/components/interface" ;
8
8
9
9
const factory = ( propsData , slots = { } ) => {
@@ -348,5 +348,26 @@ describe("[ EllipseProgressContainer.vue ]", () => {
348
348
expect ( offset ) . to . equal ( 0 ) ;
349
349
} ) ;
350
350
} ) ;
351
+ describe ( "#linePosition parser" , ( ) => {
352
+ it ( "parses default value correctly" , ( ) => {
353
+ const defaultLineMode = {
354
+ position : "center" ,
355
+ offset : 0 ,
356
+ } ;
357
+ const { position, offset } = linePositionParser ( props . linePosition . default ) ;
358
+ expect ( position ) . to . equal ( defaultLineMode . position ) ;
359
+ expect ( offset ) . to . equal ( defaultLineMode . offset ) ;
360
+ } ) ;
361
+ it ( "parses value correctly" , ( ) => {
362
+ const { position, offset } = linePositionParser ( "in 10" ) ;
363
+ expect ( position ) . to . equal ( "in" ) ;
364
+ expect ( offset ) . to . equal ( 10 ) ;
365
+ } ) ;
366
+ it ( "applies default offset correctly" , ( ) => {
367
+ const { position, offset } = lineModeParser ( "out" ) ;
368
+ expect ( position ) . to . equal ( "out" ) ;
369
+ expect ( offset ) . to . equal ( 0 ) ;
370
+ } ) ;
371
+ } ) ;
351
372
} ) ;
352
373
} ) ;
0 commit comments