From aba785f9f44fff00381651232715a0cf26defe54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 10 Sep 2026 23:24:45 +0200 Subject: [PATCH] test(e2e): expect the module-off notice on a direct visit, not a redirect A module page whose switch is off answers with the shared notice that names the switch and offers the Modules settings, so a bookmark or a report link explains itself instead of bouncing home. The vaccinations journey pinned the old redirect and went red for the behaviour the setup flow introduces on purpose. --- e2e/vaccinations.spec.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/e2e/vaccinations.spec.ts b/e2e/vaccinations.spec.ts index e46fc2b95..fbf2f2199 100644 --- a/e2e/vaccinations.spec.ts +++ b/e2e/vaccinations.spec.ts @@ -14,7 +14,7 @@ * Vorsorge reminder that shows on `/checkups`; logging the next dose moves * its due date forward through the real satisfy matcher. * 4. Module off — turning the module off in settings drops the nav entry and - * the direct visit lands on the module-off redirect, not a crash. + * the direct visit lands on the module-off notice, not a crash. * 5. a11y — axe over the list and the capture form, serious/critical only. * * The flows mutate the one seeded account, so — like `visits.spec.ts` — this @@ -248,7 +248,7 @@ test.describe("vaccinations", () => { .toBeGreaterThan(dueBefore); }); - test("turning the module off drops the nav entry and the direct visit redirects", async ({ + test("turning the module off drops the nav entry and the direct visit shows the notice", async ({ page, }) => { await page.goto("/vaccinations"); @@ -271,10 +271,16 @@ test.describe("vaccinations", () => { 0, ); - // A direct visit no longer renders the surface: the page redirects home, - // so the hero never paints and the dashboard's own landmark does. + // A direct visit no longer renders the surface. It used to redirect + // home; since the setup flow switches modules off for a new record, a + // module page answers with the shared notice that names the switch and + // offers the Modules settings, so a bookmark or a report link explains + // itself instead of bouncing. The hero never paints. await page.goto("/vaccinations"); - await expect(page).toHaveURL(/\/$|\/dashboard/, { timeout: 15_000 }); + await expect(page).toHaveURL(/\/vaccinations$/, { timeout: 15_000 }); + await expect( + page.locator('[data-slot="module-off-open-settings"]'), + ).toBeVisible({ timeout: 15_000 }); await expect( page.locator('[data-tour-id="vaccinations-hero"]'), ).toHaveCount(0);