@@ -5,8 +5,8 @@ import { configs, dragElementBy, test } from '@utils/test/playwright';
55 * Drag distances that reveal options without crossing the full swipe threshold
66 * (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
77 */
8- const DRAG_DISTANCE_ONE_OPTION = 100 ;
9- const DRAG_DISTANCE_TWO_OPTIONS = 150 ;
8+ const DRAG_DISTANCE_SINGLE_OPTION = 100 ;
9+ const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150 ;
1010
1111/**
1212 * item-sliding doesn't have mode-specific styling,
@@ -15,7 +15,7 @@ const DRAG_DISTANCE_TWO_OPTIONS = 150;
1515 * It is important to test all modes to ensure that the
1616 * child components are being rendered correctly.
1717 */
18- configs ( ) . forEach ( ( { title, screenshot, config } ) => {
18+ configs ( { modes : [ 'ios' , 'md' , 'ionic-md' ] } ) . forEach ( ( { title, screenshot, config } ) => {
1919 test . describe ( title ( 'item-sliding: basic' ) , ( ) => {
2020 test . beforeEach ( async ( { page } ) => {
2121 await page . goto ( `/src/components/item-sliding/test/basic` , config ) ;
@@ -30,9 +30,9 @@ configs().forEach(({ title, screenshot, config }) => {
3030 * Positive dragByX value to drag element from the left to the right
3131 * to reveal the options on the left side.
3232 */
33- const dragByX = config . direction === 'rtl' ? - DRAG_DISTANCE_ONE_OPTION : DRAG_DISTANCE_ONE_OPTION ;
33+ const dragByX = config . direction === 'rtl' ? - DRAG_DISTANCE_SINGLE_OPTION : DRAG_DISTANCE_SINGLE_OPTION ;
3434
35- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , undefined , 15 ) ;
35+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
3636
3737 await expect ( item ) . toHaveScreenshot ( screenshot ( 'item-sliding-start' ) ) ;
3838 } ) ;
@@ -48,9 +48,9 @@ configs().forEach(({ title, screenshot, config }) => {
4848 * Positive dragByX value to drag element from the left to the right
4949 * to reveal the options on the left side.
5050 */
51- const dragByX = config . direction === 'rtl' ? DRAG_DISTANCE_TWO_OPTIONS : - DRAG_DISTANCE_TWO_OPTIONS ;
51+ const dragByX = config . direction === 'rtl' ? DRAG_DISTANCE_MULTIPLE_OPTIONS : - DRAG_DISTANCE_MULTIPLE_OPTIONS ;
5252
53- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , undefined , 15 ) ;
53+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
5454
5555 await expect ( item ) . toHaveScreenshot ( screenshot ( 'item-sliding-end' ) ) ;
5656 } ) ;
@@ -67,7 +67,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
6767 await page . goto ( `/src/components/item-sliding/test/basic` , config ) ;
6868 const item = page . locator ( '#item2' ) ;
6969
70- await dragElementBy ( item , page , - DRAG_DISTANCE_TWO_OPTIONS , 0 , undefined , undefined , undefined , 15 ) ;
70+ await dragElementBy ( item , page , - DRAG_DISTANCE_MULTIPLE_OPTIONS , 0 , undefined , undefined , true , 15 ) ;
7171 await page . waitForChanges ( ) ;
7272
7373 // item-sliding doesn't have an easy way to tell whether it's fully open so just screenshot it
@@ -111,7 +111,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
111111 * make sure the safe area padding is applied only to that side
112112 * regardless of direction
113113 */
114- configs ( ) . forEach ( ( { title, screenshot, config } ) => {
114+ configs ( { modes : [ 'ios' , 'md' , 'ionic-md' ] } ) . forEach ( ( { title, screenshot, config } ) => {
115115 test . describe ( title ( 'item-sliding: basic' ) , ( ) => {
116116 test . describe ( 'safe area left' , ( ) => {
117117 test ( 'should have padding on the left only' , async ( { page } ) => {
@@ -146,8 +146,8 @@ configs().forEach(({ title, screenshot, config }) => {
146146 const direction = config . direction ;
147147 const item = page . locator ( 'ion-item-sliding' ) ;
148148
149- const dragByX = direction == 'rtl' ? - DRAG_DISTANCE_TWO_OPTIONS : DRAG_DISTANCE_TWO_OPTIONS ;
150- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , undefined , 15 ) ;
149+ const dragByX = direction == 'rtl' ? - DRAG_DISTANCE_MULTIPLE_OPTIONS : DRAG_DISTANCE_MULTIPLE_OPTIONS ;
150+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
151151 await page . waitForChanges ( ) ;
152152
153153 await expect ( item ) . toHaveScreenshot ( screenshot ( `item-sliding-safe-area-left` ) ) ;
@@ -187,8 +187,8 @@ configs().forEach(({ title, screenshot, config }) => {
187187 const direction = config . direction ;
188188 const item = page . locator ( 'ion-item-sliding' ) ;
189189
190- const dragByX = direction == 'rtl' ? DRAG_DISTANCE_TWO_OPTIONS : - DRAG_DISTANCE_TWO_OPTIONS ;
191- await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , undefined , 15 ) ;
190+ const dragByX = direction == 'rtl' ? DRAG_DISTANCE_MULTIPLE_OPTIONS : - DRAG_DISTANCE_MULTIPLE_OPTIONS ;
191+ await dragElementBy ( item , page , dragByX , 0 , undefined , undefined , true , 15 ) ;
192192 await page . waitForChanges ( ) ;
193193
194194 await expect ( item ) . toHaveScreenshot ( screenshot ( `item-sliding-safe-area-right` ) ) ;
0 commit comments