From 36ef7a00b78958ee1c28b0406ad6b2b4f28d38b4 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Wed, 10 Jun 2026 15:53:55 -0400 Subject: [PATCH] test(06-05): add failing dead-end AuthSplash test for exhausted redirect guard (D-11) --- apps/pwa/src/components/CalendarShell.test.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/pwa/src/components/CalendarShell.test.tsx b/apps/pwa/src/components/CalendarShell.test.tsx index e5a61f5..33c4497 100644 --- a/apps/pwa/src/components/CalendarShell.test.tsx +++ b/apps/pwa/src/components/CalendarShell.test.tsx @@ -217,4 +217,14 @@ describe('CalendarShell — CAL-03 render smoke', () => { renderWithClient() // Error renders asynchronously after query settles }) + + it('renders dead-end AuthSplash when redirect guard is already exhausted (D-11)', async () => { + // Simulate the one-shot guard having already fired (prior redirect attempt) + sessionStorage.setItem('familysync.loginRedirectAttempted', '1') + ;(fetchMe as Mock).mockRejectedValue(new Error('401')) + renderWithClient() + // After the auth error and the guard is exhausted, dead-end copy must be visible + const tapToRetry = await screen.findByText(/Tap here to try again/i) + expect(tapToRetry).toBeDefined() + }) })