From 74102ec386dbdaf06560ee5a370eae11a5aba907 Mon Sep 17 00:00:00 2001 From: Babissimo Date: Mon, 14 Sep 2026 11:08:38 +0100 Subject: [PATCH] test(e2e): match the Coverage toggle exactly The "Coverage gaps" button added in #358 also matches /Coverage/i, so both toolbar assertions started failing on a Playwright strict-mode violation. That job only runs on a main push, so the PR that introduced the button could not have caught it, and every main push since has failed: production has not deployed since 11 September. Pin both locators to the exact accessible name. Playwright's own error output suggested this locator for the button we want. Co-Authored-By: Claude Opus 5 --- frontend/e2e/live-map.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/e2e/live-map.spec.ts b/frontend/e2e/live-map.spec.ts index 88c8c5a9..4c4727c9 100644 --- a/frontend/e2e/live-map.spec.ts +++ b/frontend/e2e/live-map.spec.ts @@ -144,7 +144,8 @@ test.describe("Live Map — map rendering", () => { test("toolbar shows Coverage / Labels / Trails toggle buttons", async ({ page }) => { await page.goto(BASE); await expect(page.locator(".live-map-toolbar")).toBeVisible({ timeout: 10_000 }); - await expect(page.getByRole("button", { name: /Coverage/i })).toBeVisible(); + // "Coverage gaps" also matches a loose /Coverage/, so this must stay exact. + await expect(page.getByRole("button", { name: "Coverage", exact: true })).toBeVisible(); await expect(page.getByRole("button", { name: /Labels/i })).toBeVisible(); await expect(page.getByRole("button", { name: /Trails/i })).toBeVisible(); }); @@ -258,7 +259,7 @@ test.describe("Live Map — toolbar toggles", () => { await page.goto(BASE); await expect(page.locator(".live-map-toolbar")).toBeVisible({ timeout: 10_000 }); - const btn = page.getByRole("button", { name: /Coverage/i }); + const btn = page.getByRole("button", { name: "Coverage", exact: true }); const initialActive = await btn.evaluate((el) => el.classList.contains("active")); await btn.click();