Skip to content

Commit f7df147

Browse files
committed
test(item-sliding): create shared constants
1 parent ed95dac commit f7df147

6 files changed

Lines changed: 13 additions & 26 deletions

File tree

core/src/components/item-sliding/test/basic/item-sliding.e2e.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, dragElementBy, test } from '@utils/test/playwright';
33

4-
/**
5-
* Drag distances that reveal options without crossing the full swipe threshold
6-
* (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
7-
*/
8-
const DRAG_DISTANCE_SINGLE_OPTION = 100;
9-
const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
4+
import { DRAG_DISTANCE_SINGLE_OPTION, DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils';
105

116
/**
127
* item-sliding doesn't have mode-specific styling,

core/src/components/item-sliding/test/icons/item-sliding.e2e.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test, dragElementBy } from '@utils/test/playwright';
33

4-
/**
5-
* Drag distances that reveal options without crossing the full swipe threshold
6-
* (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
7-
*/
8-
const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
4+
import { DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils';
95

106
/**
117
* item-sliding doesn't have mode-specific styling,

core/src/components/item-sliding/test/scroll-target/item-sliding.e2e.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test, dragElementBy } from '@utils/test/playwright';
33

4-
/**
5-
* Drag distances that reveal options without crossing the full swipe threshold
6-
* (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
7-
*/
8-
const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
4+
import { DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils';
95

106
/**
117
* This behavior does not vary across modes/directions

core/src/components/item-sliding/test/shapes/item-sliding.e2e.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test, dragElementBy } from '@utils/test/playwright';
33

4-
/**
5-
* Drag distances that reveal options without crossing the full swipe threshold
6-
* (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
7-
*/
8-
const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
4+
import { DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils';
95

106
/**
117
* The shapes on the `item-option` do not vary by direction

core/src/components/item-sliding/test/states/item-sliding.e2e.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test, dragElementBy } from '@utils/test/playwright';
33

4-
/**
5-
* Drag distances that reveal options without crossing the full swipe threshold
6-
* (optsWidth + SWIPE_MARGIN). A narrower options panel requires a shorter drag.
7-
*/
8-
const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
4+
import { DRAG_DISTANCE_MULTIPLE_OPTIONS } from '../test.utils';
95

106
/**
117
* This behavior does not vary across modes

core/src/components/item-sliding/test/test.utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import { expect } from '@playwright/test';
22
import type { E2EPage, ScreenshotFn } from '@utils/test/playwright';
33

4+
/**
5+
* Drag distances that reveal options without crossing the full swipe
6+
* threshold (optsWidth + SWIPE_MARGIN). A narrower options panel
7+
* requires a shorter drag.
8+
*/
9+
export const DRAG_DISTANCE_SINGLE_OPTION = 100;
10+
export const DRAG_DISTANCE_MULTIPLE_OPTIONS = 150;
11+
412
/**
513
* Warning: This function will fail when in RTL mode.
614
* TODO(FW-3711): Remove the `directions` config when this issue preventing

0 commit comments

Comments
 (0)