From 8b1f374855825398dd5fae13dccc51bddde92629 Mon Sep 17 00:00:00 2001 From: Kristian Wind Date: Mon, 17 Aug 2026 21:54:26 +0200 Subject: [PATCH] test(e2e): drive a member opening a project, not just seeing it in the sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invite test proved the shared project reached the invitee's sidebar and stopped there. A member's project page is a different path from an owner's — different role, different guards — and it was never opened by anything. It also matters that the page shows "Projektet findes ikke, eller du har ikke adgang til det" while it is still loading, because `project` starts null and there is no loading state. A failed load and a slow one look identical, which makes this exactly the kind of thing a person reports and a test suite cannot see. Signs in as the invited account in its own context and clicks through to the project, asserting the heading renders and that message is absent. Co-Authored-By: Claude Opus 5 --- web/e2e/smoke.spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/web/e2e/smoke.spec.js b/web/e2e/smoke.spec.js index 312e0e5..df26aaa 100644 --- a/web/e2e/smoke.spec.js +++ b/web/e2e/smoke.spec.js @@ -473,6 +473,26 @@ test('et invitationslink opretter kontoen og giver adgang til projektet', async expect(inviteeTrouble.filter((t) => t !== 'GET /api/v1/auth/me → 401')).toEqual([]); await context.close(); + // The invitee opens the project. Nothing has ever driven this: the assertion + // above only proved the project reaches their *sidebar*, and a member's view + // of a project page is a different code path from an owner's — different role, + // different guards, and the page shows the same "findes ikke" message while it + // is still loading as it does when the load failed. + const inviteePage = await browser.newContext({ storageState: { cookies: [], origins: [] } }); + const member = await inviteePage.newPage(); + const memberTrouble = watchForTrouble(member); + await member.goto('/'); + await member.getByLabel('E-mail').fill('nabo@example.dk'); + await member.getByLabel('Adgangskode').fill('et langt kodeord til test'); + await member.getByRole('button', { name: 'Log ind' }).click(); + + const theirs = member.getByRole('navigation', { name: 'Hovedmenu' }); + await theirs.getByRole('link', { name: /Fælleshuset/ }).click(); + await expect(member.getByRole('heading', { name: 'Fælleshuset' })).toBeVisible(); + await expect(member.getByText('findes ikke')).toHaveCount(0); + expect(memberTrouble.filter((t) => t !== 'GET /api/v1/auth/me → 401')).toEqual([]); + await inviteePage.close(); + // Now that there is somebody to delegate to, the inviter can — and the view // for it appears. It is hidden on an instance with one person, where it could // never have anything in it.