test(auth): add isPublicRoute boundary tests for sub-paths and trailing slash
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,15 @@ describe('auth guard (hooks.server.ts handle)', () => {
|
|||||||
expect(resolve).toHaveBeenCalledWith(event);
|
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'])(
|
it.each(['/_app/immutable/chunks/app.js', '/favicon.ico'])(
|
||||||
'allows static asset %s without auth',
|
'allows static asset %s without auth',
|
||||||
async (path) => {
|
async (path) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user