File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -285,4 +285,37 @@ describe('Slide.vue', () => {
285285 } , 20 )
286286 } )
287287 } )
288+
289+ it ( 'should change vertical pageIndex when direction is vertical' , function ( done ) {
290+ this . timeout ( 10000 )
291+ vm = createVue ( {
292+ template : `
293+ <cube-slide :threshold="threshold" direction="vertical" style="width:300px;height:100px;">
294+ <cube-slide-item v-for="(item,index) in items" :key="index" :item="item"></cube-slide-item>
295+ </cube-slide>
296+ ` ,
297+ data : {
298+ items,
299+ threshold : 0.1
300+ }
301+ } )
302+
303+ vm . $nextTick ( ( ) => {
304+ expect ( vm . currentPageIndex ) . to . equal ( 0 )
305+ dispatchSwipe ( vm . $el , [
306+ {
307+ pageX : 180 ,
308+ pageY : 100
309+ } ,
310+ {
311+ pageX : 180 ,
312+ pageY : 20
313+ }
314+ ] , 100 )
315+ setTimeout ( ( ) => {
316+ expect ( vm . currentPageIndex ) . to . equal ( 1 )
317+ done ( )
318+ } , 2000 )
319+ } )
320+ } )
288321} )
You can’t perform that action at this time.
0 commit comments