diff --git a/e2e/coach-layout.spec.ts b/e2e/coach-layout.spec.ts index d13cf9965..67b455d96 100644 --- a/e2e/coach-layout.spec.ts +++ b/e2e/coach-layout.spec.ts @@ -41,7 +41,10 @@ import { aiBlockAvailable, serveAiBlock } from "./setup/ai-capabilities"; * Screenshots are attached to the report (no pixel baselines). */ -const NOW = Date.now(); +// A fixed midday, pinned in the browser too (see beforeEach): the panel groups +// conversations by the browser's local day, so a run just after midnight in +// the runner's or the profile's zone would move "an hour ago" into yesterday. +const NOW = Date.parse("2026-06-04T12:00:00Z"); const HOUR = 60 * 60 * 1000; interface Conversation { @@ -406,6 +409,7 @@ test.describe("Coach page frame", () => { testInfo.project.name !== "chromium-desktop", "each case sets its own viewport; the desktop project runs them all", ); + await page.clock.setFixedTime(new Date(NOW)); await serveAiBlock(page, aiBlockAvailable()); await page.emulateMedia({ reducedMotion: "reduce" }); }); diff --git a/src/components/insights/coach-panel/__tests__/turn-steps.test.tsx b/src/components/insights/coach-panel/__tests__/turn-steps.test.tsx index d29209a83..0bda1cd08 100644 --- a/src/components/insights/coach-panel/__tests__/turn-steps.test.tsx +++ b/src/components/insights/coach-panel/__tests__/turn-steps.test.tsx @@ -363,12 +363,12 @@ describe("a step row copied out of the list", () => { "de", ); // What a selection copies: every text node except the unselectable ones. + // Reads this test's own static markup; not a sanitiser for input. const copied = html - .replace( - /]*class="[^"]*\bselect-none\b[^"]*"[^>]*>[^<]*<\/span>/g, - "", - ) - .replace(/<[^>]+>/g, "") + .split(/]*class="[^"]*\bselect-none\b[^"]*"[^>]*>[^<]*<\/span>/) + .join("") + .split(/<[^>]*>/) + .join("") .replace(/\s+/g, " ") .trim(); expect(copied).toBe("Gewicht ยท letzte 90 Tage");