fix indentation

This commit is contained in:
Yury Semikhatsky 2025-01-07 11:55:58 -08:00
parent 029dc5ef6c
commit 07539d0746

View file

@ -49,7 +49,7 @@ async function pan(locator: Locator, deltaX?: number, deltaY?: number, steps?: n
clientY: centerY + deltaY * i / steps, clientY: centerY + deltaY * i / steps,
}]; }];
await locator.dispatchEvent('touchmove', await locator.dispatchEvent('touchmove',
{ touches, changedTouches: touches, targetTouches: touches }); { touches, changedTouches: touches, targetTouches: touches });
} }
await locator.dispatchEvent('touchend'); await locator.dispatchEvent('touchend');
@ -57,7 +57,7 @@ async function pan(locator: Locator, deltaX?: number, deltaY?: number, steps?: n
test(`pan gesture to move the map`, async ({ page }) => { test(`pan gesture to move the map`, async ({ page }) => {
await page.goto('https://www.google.com/maps/place/@37.4117722,-122.0713234,15z', await page.goto('https://www.google.com/maps/place/@37.4117722,-122.0713234,15z',
{ waitUntil: 'commit' }); { waitUntil: 'commit' });
await page.getByRole('button', { name: 'Keep using web' }).click(); await page.getByRole('button', { name: 'Keep using web' }).click();
await expect(page.getByRole('button', { name: 'Keep using web' })).not.toBeVisible(); await expect(page.getByRole('button', { name: 'Keep using web' })).not.toBeVisible();
// Get the map element. // Get the map element.
@ -105,7 +105,7 @@ async function pinch(locator: Locator,
}, },
]; ];
await locator.dispatchEvent('touchstart', await locator.dispatchEvent('touchstart',
{ touches, changedTouches: touches, targetTouches: touches }); { touches, changedTouches: touches, targetTouches: touches });
// Move the touch points towards or away from each other. // Move the touch points towards or away from each other.
for (let i = 1; i <= steps; i++) { for (let i = 1; i <= steps; i++) {
@ -113,7 +113,7 @@ async function pinch(locator: Locator,
const touches = [ const touches = [
{ {
identifier: 0, identifier: 0,
clientX:centerX - offset, clientX: centerX - offset,
clientY: centerY, clientY: centerY,
}, },
{ {
@ -123,14 +123,15 @@ async function pinch(locator: Locator,
}, },
]; ];
await locator.dispatchEvent('touchmove', await locator.dispatchEvent('touchmove',
{ touches, changedTouches: touches, targetTouches: touches }); { touches, changedTouches: touches, targetTouches: touches });
} }
await locator.dispatchEvent('touchend', { touches: [], changedTouches: [], targetTouches: [] }); await locator.dispatchEvent('touchend', { touches: [], changedTouches: [], targetTouches: [] });
} }
test(`pinch in gesture to zoom out the map`, async ({ page }) => { test(`pinch in gesture to zoom out the map`, async ({ page }) => {
await page.goto('https://www.google.com/maps/place/@37.4117722,-122.0713234,15z', { waitUntil: 'commit' }); await page.goto('https://www.google.com/maps/place/@37.4117722,-122.0713234,15z',
{ waitUntil: 'commit' });
await page.getByRole('button', { name: 'Keep using web' }).click(); await page.getByRole('button', { name: 'Keep using web' }).click();
await expect(page.getByRole('button', { name: 'Keep using web' })).not.toBeVisible(); await expect(page.getByRole('button', { name: 'Keep using web' })).not.toBeVisible();
// Get the map element. // Get the map element.