Skip to content

Commit e034fbe

Browse files
committed
Adjust long touch recognition time
1 parent 2a79b26 commit e034fbe

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

test/e2e/core/touchDevice.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ test.describe('Playwright touch device tests', () => {
1919
});
2020

2121
test('Tap/Long press to show layer control', async () => {
22-
await page.pause();
2322
const layerControl = await page.locator(
2423
'div > div.leaflet-control-container > div.leaflet-top.leaflet-right > div'
2524
);
@@ -42,17 +41,13 @@ test.describe('Playwright touch device tests', () => {
4241
const viewer = await page.locator('mapml-viewer');
4342
await viewer.tap({ position: { x: 150, y: 150 } });
4443
await layerControl.tap();
45-
await layerControl.dispatchEvent('touchstart');
46-
await page.waitForTimeout(2000);
47-
await layerControl.dispatchEvent('touchend');
48-
await page.waitForTimeout(2000);
44+
await layerControl.tap({ delay: 800 }); // Simulates a long tap/press
4945

5046
className = await layerControl.evaluate(
5147
(el) =>
5248
el.classList.contains('leaflet-control-layers-expanded') &&
5349
el._isExpanded
5450
);
55-
await page.waitForTimeout(2000);
5651
expect(className).toEqual(true);
5752

5853
// expect the layer context menu not show after the long press

0 commit comments

Comments
 (0)