wip
This commit is contained in:
30
tests/unit/website/auth/DashboardAndLayoutAuth.test.tsx
Normal file
30
tests/unit/website/auth/DashboardAndLayoutAuth.test.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
/**
|
||||
* Auth + caching behavior for RootLayout and Dashboard.
|
||||
*
|
||||
* These tests assert that:
|
||||
* - RootLayout is marked dynamic so it re-evaluates cookies per request.
|
||||
* - DashboardPage is also dynamic (no static caching of auth state).
|
||||
*/
|
||||
|
||||
describe('RootLayout auth caching behavior', () => {
|
||||
it('is configured as dynamic to avoid static auth caching', async () => {
|
||||
const layoutModule = await import('../../../../apps/website/app/layout');
|
||||
|
||||
// Next.js dynamic routing flag
|
||||
const dynamic = (layoutModule as any).dynamic;
|
||||
|
||||
expect(dynamic).toBe('force-dynamic');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Dashboard auth caching behavior', () => {
|
||||
it('is configured as dynamic to evaluate auth per request', async () => {
|
||||
const dashboardModule = await import('../../../../apps/website/app/dashboard/page');
|
||||
|
||||
const dynamic = (dashboardModule as any).dynamic;
|
||||
|
||||
expect(dynamic).toBe('force-dynamic');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user