11import { expect } from '@playwright/test' ;
22import { configs , dragElementBy , test } from '@utils/test/playwright' ;
33
4- import { DRAG_DISTANCE_SINGLE_OPTION , DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils' ;
4+ import {
5+ DRAG_DISTANCE_SINGLE_OPTION ,
6+ DRAG_DISTANCE_MULTIPLE_OPTIONS ,
7+ DRAG_STEPS_UNDER_FULL_SWIPE ,
8+ } from '../test.utils' ;
59
610/**
711 * item-sliding doesn't have mode-specific styling,
@@ -27,7 +31,7 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf
2731 */
2832 const dragByX = config . direction === 'rtl' ? - DRAG_DISTANCE_SINGLE_OPTION : DRAG_DISTANCE_SINGLE_OPTION ;
2933
30- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
34+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , DRAG_STEPS_UNDER_FULL_SWIPE ) ;
3135
3236 await expect ( item ) . toHaveScreenshot ( screenshot ( 'item-sliding-start' ) ) ;
3337 } ) ;
@@ -45,7 +49,7 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf
4549 */
4650 const dragByX = config . direction === 'rtl' ? DRAG_DISTANCE_MULTIPLE_OPTIONS : - DRAG_DISTANCE_MULTIPLE_OPTIONS ;
4751
48- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
52+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , DRAG_STEPS_UNDER_FULL_SWIPE ) ;
4953
5054 await expect ( item ) . toHaveScreenshot ( screenshot ( 'item-sliding-end' ) ) ;
5155 } ) ;
@@ -62,7 +66,16 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
6266 await page . goto ( `/src/components/item-sliding/test/basic` , config ) ;
6367 const item = page . locator ( '#item2' ) ;
6468
65- await dragElementBy ( item , page , - DRAG_DISTANCE_MULTIPLE_OPTIONS , 0 , undefined , undefined , true , 15 ) ;
69+ await dragElementBy (
70+ item ,
71+ page ,
72+ - DRAG_DISTANCE_MULTIPLE_OPTIONS ,
73+ 0 ,
74+ undefined ,
75+ undefined ,
76+ true ,
77+ DRAG_STEPS_UNDER_FULL_SWIPE
78+ ) ;
6679 await page . waitForChanges ( ) ;
6780
6881 // item-sliding doesn't have an easy way to tell whether it's fully open so just screenshot it
@@ -142,7 +155,7 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf
142155 const item = page . locator ( 'ion-item-sliding' ) ;
143156
144157 const dragByX = direction == 'rtl' ? - DRAG_DISTANCE_MULTIPLE_OPTIONS : DRAG_DISTANCE_MULTIPLE_OPTIONS ;
145- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
158+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , DRAG_STEPS_UNDER_FULL_SWIPE ) ;
146159 await page . waitForChanges ( ) ;
147160
148161 await expect ( item ) . toHaveScreenshot ( screenshot ( `item-sliding-safe-area-left` ) ) ;
@@ -183,7 +196,7 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf
183196 const item = page . locator ( 'ion-item-sliding' ) ;
184197
185198 const dragByX = direction == 'rtl' ? DRAG_DISTANCE_MULTIPLE_OPTIONS : - DRAG_DISTANCE_MULTIPLE_OPTIONS ;
186- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
199+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , DRAG_STEPS_UNDER_FULL_SWIPE ) ;
187200 await page . waitForChanges ( ) ;
188201
189202 await expect ( item ) . toHaveScreenshot ( screenshot ( `item-sliding-safe-area-right` ) ) ;
0 commit comments