From 13bbfa7abd2ffd64cdd4ff20b8f9440d6754697d Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 2 Jun 2026 20:34:45 +0200 Subject: [PATCH] test(briefwechsel): guard the removed /briefwechsel route returns 404 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an active e2e spec asserting /briefwechsel 404s on the styled app error page. The old assertion lived in stammbaum.spec.ts inside a test.skip() block (never executed) and asserted the opposite — remove it. Drop /briefwechsel from the auth protected-route loop; /documents (the redirect target) sits behind the same authenticated() rule, so coverage is preserved. Co-Authored-By: Claude Opus 4.8 --- frontend/e2e/auth.spec.ts | 2 +- frontend/e2e/briefwechsel-removed.spec.ts | 15 +++++++++++++++ frontend/e2e/stammbaum.spec.ts | 8 -------- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 frontend/e2e/briefwechsel-removed.spec.ts diff --git a/frontend/e2e/auth.spec.ts b/frontend/e2e/auth.spec.ts index a7b2d527..5590ab1a 100644 --- a/frontend/e2e/auth.spec.ts +++ b/frontend/e2e/auth.spec.ts @@ -26,7 +26,7 @@ test.describe('Authentication', () => { }); test('protected routes redirect to /login without session', async ({ page }) => { - for (const url of ['/documents/new', '/persons', '/briefwechsel']) { + for (const url of ['/documents/new', '/persons']) { await page.goto(url); await expect(page).toHaveURL(/\/login/); } diff --git a/frontend/e2e/briefwechsel-removed.spec.ts b/frontend/e2e/briefwechsel-removed.spec.ts new file mode 100644 index 00000000..f9dc7a7b --- /dev/null +++ b/frontend/e2e/briefwechsel-removed.spec.ts @@ -0,0 +1,15 @@ +import { test, expect } from '@playwright/test'; + +// The standalone Briefwechsel view was removed (its one inbound link now +// deep-links into document search). The old URL is allowed to 404 — no +// redirect shim. This guard runs in the authenticated project so the route +// genuinely 404s on the styled app error page instead of bouncing to /login. +test.describe('Briefwechsel view removed', () => { + test('/briefwechsel returns 404 on the styled app error page', async ({ page }) => { + const response = await page.goto('/briefwechsel'); + + expect(response?.status()).toBe(404); + // +error.svelte renders the status code prominently. + await expect(page.getByText('404')).toBeVisible(); + }); +}); diff --git a/frontend/e2e/stammbaum.spec.ts b/frontend/e2e/stammbaum.spec.ts index ed414efb..6b5625d9 100644 --- a/frontend/e2e/stammbaum.spec.ts +++ b/frontend/e2e/stammbaum.spec.ts @@ -4,14 +4,6 @@ import { test, expect } from '@playwright/test'; test.describe('Stammbaum — issue #358', () => { test.skip(); - test('nav swap: /briefwechsel still renders without 404', async ({ page }) => { - // Plan journey 4: the /briefwechsel route must stay intact even though the - // AppNav now points at /stammbaum. - const response = await page.goto('/briefwechsel'); - expect(response?.status()).toBeLessThan(400); - await expect(page).toHaveURL(/\/briefwechsel/); - }); - test('/stammbaum renders the page heading', async ({ page }) => { await page.goto('/stammbaum'); await expect(page.getByRole('heading', { name: 'Stammbaum' })).toBeVisible();