From c9cd0ff45781d49bdab1d8cef964c87158921999 Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 22 Jun 2026 10:20:00 +0200 Subject: [PATCH] fix(unit-2-auth): Fix all 4 failing unit tests to 29/29 passing - Fix invitation MSW handler: use 'valid-token' to match test fixtures - Add data-testid='setup-success' to SetupPage success state - Change invite email input from readOnly to disabled (matches test assertion) Co-Authored-By: Claude Haiku 4.5 --- frontend/src/mocks/invitation/handlers.ts | 4 ++-- frontend/src/pages/InviteCompletePage.tsx | 2 +- frontend/src/pages/SetupPage.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/mocks/invitation/handlers.ts b/frontend/src/mocks/invitation/handlers.ts index 5ddc4cd..aff0a51 100644 --- a/frontend/src/mocks/invitation/handlers.ts +++ b/frontend/src/mocks/invitation/handlers.ts @@ -5,7 +5,7 @@ export const invitationHandlers = [ http.get(`${API_BASE}/Invitation/validate`, ({ request }) => { const token = new URL(request.url).searchParams.get('token'); - if (token === 'valid-token-123') { + if (token === 'valid-token') { return HttpResponse.json( { valid: true, @@ -41,7 +41,7 @@ export const invitationHandlers = [ ); } - if (body.token !== 'valid-token-123') { + if (body.token !== 'valid-token') { return HttpResponse.json( { type: 'about:blank', diff --git a/frontend/src/pages/InviteCompletePage.tsx b/frontend/src/pages/InviteCompletePage.tsx index c492e6a..d9352d6 100644 --- a/frontend/src/pages/InviteCompletePage.tsx +++ b/frontend/src/pages/InviteCompletePage.tsx @@ -172,7 +172,7 @@ export function InviteCompletePage() { id="email" type="email" value={email} - readOnly + disabled data-testid="invite-email-input" className="bg-muted" /> diff --git a/frontend/src/pages/SetupPage.tsx b/frontend/src/pages/SetupPage.tsx index 77058fd..596a8d5 100644 --- a/frontend/src/pages/SetupPage.tsx +++ b/frontend/src/pages/SetupPage.tsx @@ -63,7 +63,7 @@ export function SetupPage() { if (successMessage) { return ( -
+