@@ -152,6 +152,14 @@ describe("draggable.vue when initialized with list", () => {
152
152
expect ( vm . visibleIndexes ) . toEqual ( [ - 1 , 0 , 1 , 2 , - 1 ] ) ;
153
153
} ) ;
154
154
155
+ it ( "update indexes" , async ( ) => {
156
+ await Vue . nextTick ( ) ;
157
+ const computeIndexes = jest . fn ( ) ;
158
+ wrapper . setMethods ( { computeIndexes } )
159
+ wrapper . setProps ( { list : [ "c" , "d" , "e" , "f" , "g" ] } ) ;
160
+ expect ( computeIndexes ) . toHaveBeenCalled ( )
161
+ } ) ;
162
+
155
163
it ( "set realList" , ( ) => {
156
164
expect ( vm . realList ) . toEqual ( [ "a" , "b" , "c" ] ) ;
157
165
} ) ;
@@ -575,6 +583,14 @@ describe("draggable.vue when initialized with value", () => {
575
583
expect ( vm . visibleIndexes ) . toEqual ( [ 0 , 1 , 2 ] ) ;
576
584
} ) ;
577
585
586
+ it ( "update indexes" , async ( ) => {
587
+ await Vue . nextTick ( ) ;
588
+ const computeIndexes = jest . fn ( ) ;
589
+ wrapper . setMethods ( { computeIndexes } )
590
+ wrapper . setProps ( { value : [ "c" , "d" , "e" , "f" , "g" ] } ) ;
591
+ expect ( computeIndexes ) . toHaveBeenCalled ( )
592
+ } ) ;
593
+
578
594
it ( "set realList" , ( ) => {
579
595
expect ( vm . realList ) . toEqual ( [ "a" , "b" , "c" ] ) ;
580
596
} ) ;
0 commit comments