File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const SortableFake = {
6
6
} ;
7
7
Sortable . mockImplementation ( ( ) => SortableFake ) ;
8
8
import draggable from "@/vuedraggable" ;
9
+ import Vue from "vue" ;
9
10
10
11
let wrapper ;
11
12
let vm ;
@@ -135,4 +136,26 @@ describe("draggable.vue", () => {
135
136
sortableOption : "value"
136
137
} ) ;
137
138
} )
139
+
140
+ test . each (
141
+ [
142
+ [ "onChoose" , "choose" ] ,
143
+ [ "onSort" , "sort" ] ,
144
+ [ "onFilter" , "filter" ] ,
145
+ [ "onClone" , "clone" ]
146
+ ]
147
+ ) (
148
+ "when event %s is emitted from sortable" ,
149
+ async ( evt , vueEvt ) => {
150
+ const callBack = Sortable . mock . calls [ 0 ] [ 1 ] [ evt ] ;
151
+ const evtInfo = {
152
+ data : { }
153
+ } ;
154
+ callBack ( evtInfo ) ;
155
+ await Vue . nextTick ( ) ;
156
+ expect ( wrapper . emitted ( ) ) . toEqual ( {
157
+ [ vueEvt ] : [ [ evtInfo ] ]
158
+ } ) ;
159
+ }
160
+ ) ;
138
161
} ) ;
You can’t perform that action at this time.
0 commit comments