From b6bca0229b58627b025d94a4fd1d900c6f051b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Sat, 11 Apr 2026 00:59:03 +0200 Subject: [PATCH] Fix E2E strict mode violations in multi-day tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - "km" locator matched both header summary and stats footer — narrowed to match "km ·" pattern unique to the header - "Day 1" locator matched both map label pill and sidebar header — scoped to sidebar with page.locator("aside") Co-Authored-By: Claude Opus 4.6 (1M context) --- e2e/planner.test.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/e2e/planner.test.ts b/e2e/planner.test.ts index 8bd5eb8..9a54bb5 100644 --- a/e2e/planner.test.ts +++ b/e2e/planner.test.ts @@ -251,8 +251,8 @@ test.describe("Planner", () => { await expect(page.getByText("Connected")).toBeVisible({ timeout: 15000 }); await expect(page.getByText("Waypoints (3)")).toBeVisible({ timeout: 5000 }); - // Wait for route to compute - await expect(page.getByText(/\d+\.\d+ km/)).toBeVisible({ timeout: 20000 }); + // Wait for route to compute — match the header summary which has "km ·" + await expect(page.getByText(/\d+\.\d+ km ·/)).toBeVisible({ timeout: 20000 }); // Hover waypoint 2 to reveal controls, click the overnight toggle (moon icon) const waypointRows = page.locator("li").filter({ has: page.locator("span.rounded-full") }); @@ -261,9 +261,10 @@ test.describe("Planner", () => { const moonButton = secondRow.getByTitle(/overnight/i); await moonButton.click(); - // Day breakdown should appear - await expect(page.getByText("Day 1")).toBeVisible({ timeout: 5000 }); - await expect(page.getByText("Day 2")).toBeVisible({ timeout: 5000 }); + // Day breakdown should appear in the sidebar + const sidebar = page.locator("aside"); + await expect(sidebar.getByText("Day 1")).toBeVisible({ timeout: 5000 }); + await expect(sidebar.getByText("Day 2")).toBeVisible({ timeout: 5000 }); }); test("export GPX with day breaks includes overnight metadata", async ({ page, request }) => { @@ -306,7 +307,8 @@ test.describe("Planner", () => { // Wait for waypoints to load await expect(page.getByText("Waypoints (3)")).toBeVisible({ timeout: 10000 }); - // The overnight waypoint should show day breakdown - await expect(page.getByText("Day 1")).toBeVisible({ timeout: 5000 }); + // The overnight waypoint should show day breakdown in the sidebar + const sidebar = page.locator("aside"); + await expect(sidebar.getByText("Day 1")).toBeVisible({ timeout: 5000 }); }); });