From cc74c0042af494f5cba64db7d7700b7f3328ad38 Mon Sep 17 00:00:00 2001 From: Marcel Raddatz Date: Thu, 2 Apr 2026 13:55:48 +0200 Subject: [PATCH] test(auth): add isPublicRoute boundary tests for sub-paths and trailing slash Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/hooks.server.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/hooks.server.test.ts b/frontend/src/hooks.server.test.ts index d1b16b6..a57bcc3 100644 --- a/frontend/src/hooks.server.test.ts +++ b/frontend/src/hooks.server.test.ts @@ -39,6 +39,15 @@ describe('auth guard (hooks.server.ts handle)', () => { expect(resolve).toHaveBeenCalledWith(event); }); + it.each(['/login', '/login/', '/register', '/invite/abc123'])( + 'allows public route %s without auth', + async (path) => { + const { event, resolve } = createEvent(path); + await handle({ event, resolve }); + expect(resolve).toHaveBeenCalledWith(event); + } + ); + it.each(['/_app/immutable/chunks/app.js', '/favicon.ico'])( 'allows static asset %s without auth', async (path) => {