From 5518122b69af7454230217207043162549920b46 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 5 May 2026 19:08:57 +0200 Subject: [PATCH] =?UTF-8?q?test(e2e):=20fix=20notification-deep-link=20?= =?UTF-8?q?=E2=80=94=20relative=20paths,=20afterAll=20cleanup,=20accurate?= =?UTF-8?q?=20J10=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- frontend/e2e/notification-deep-link.spec.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/e2e/notification-deep-link.spec.ts b/frontend/e2e/notification-deep-link.spec.ts index fd301f4f..68fdee1f 100644 --- a/frontend/e2e/notification-deep-link.spec.ts +++ b/frontend/e2e/notification-deep-link.spec.ts @@ -25,15 +25,13 @@ let commentId: string; test.describe('Notification deep-link scroll', () => { test.beforeAll(async ({ request }) => { - const baseURL = process.env.E2E_BASE_URL ?? 'http://localhost:3000'; - const createRes = await request.post('/api/documents', { multipart: { title: 'E2E Deep-Link Test', documentDate: '1945-05-08' } }); if (!createRes.ok()) throw new Error(`Create document failed: ${createRes.status()}`); const doc = await createRes.json(); docId = doc.id; - docHref = `${baseURL}/documents/${docId}`; + docHref = `/documents/${docId}`; const uploadRes = await request.put(`/api/documents/${docId}`, { multipart: { @@ -74,6 +72,10 @@ test.describe('Notification deep-link scroll', () => { commentId = comment.id; }); + test.afterAll(async ({ request }) => { + if (docId) await request.delete(`/api/documents/${docId}`); + }); + async function openDeepLink(page: Page) { const url = `${docHref}?commentId=${commentId}&annotationId=${annotationId}`; await page.goto(url); @@ -119,16 +121,17 @@ test.describe('Notification deep-link scroll', () => { // ── Notification bell — J10 ──────────────────────────────────────────────── // // Verifies the notification bell in the global header: clicking it opens the -// dropdown, an unread notification is visible, clicking it marks it as read -// and navigates to the target document. +// dropdown and it closes on Escape. Full mark-as-read and navigation flows are +// tracked in a follow-up issue. test.describe('Notification bell', () => { let bellDocId: string; test.beforeAll(async ({ request }) => { + const stamp = Date.now().toString(36); // Seed a document + comment to ensure the notification list has content to render. const createRes = await request.post('/api/documents', { - multipart: { title: 'E2E Bell Test Doc', documentDate: '1930-01-01' } + multipart: { title: `E2E Bell Test Doc ${stamp}`, documentDate: '1930-01-01' } }); if (!createRes.ok()) throw new Error(`Create document failed: ${createRes.status()}`); const doc = await createRes.json(); @@ -140,6 +143,10 @@ test.describe('Notification bell', () => { if (!commentRes.ok()) throw new Error(`Create comment failed: ${commentRes.status()}`); }); + test.afterAll(async ({ request }) => { + if (bellDocId) await request.delete(`/api/documents/${bellDocId}`); + }); + test('bell opens dropdown, shows notifications list', async ({ page }) => { test.setTimeout(30_000);