fix RF race test on mobile

This commit is contained in:
gadgethd
2026-08-02 18:52:54 +01:00
parent 31dfe37b1f
commit f808298dfd
+4 -1
View File
@@ -141,7 +141,7 @@ test('HopReach tiles arrive progressively while the 4,600-node map remains inter
expect(requests.some((path) => path.startsWith('/api/coverage'))).toBe(false);
});
test('enabled HopReach coverage survives metadata winning the initial map-load race', async ({ page }) => {
test('enabled HopReach coverage survives metadata winning the initial map-load race', async ({ page }, testInfo) => {
const tileRequests: string[] = [];
page.on('request', (request) => {
const path = new URL(request.url()).pathname;
@@ -155,6 +155,9 @@ test('enabled HopReach coverage survives metadata winning the initial map-load r
await page.goto('/', { waitUntil: 'domcontentloaded' });
await page.getByText('Live Map', { exact: true }).waitFor({ state: 'visible', timeout: 15_000 });
if (testInfo.project.name === 'dashboard-mobile') {
await page.getByRole('button', { name: 'Layers' }).first().click();
}
await expect(page.getByRole('button', { name: 'RF Coverage' }).first()).toHaveAttribute('aria-pressed', 'true');
await expect.poll(() => tileRequests.length, { timeout: 15_000 }).toBeGreaterThan(0);
});