AI Implementation feature(823): Landing Page and Login/Register Modal (#11)

This commit was merged in pull request #11.
This commit is contained in:
2026-07-21 18:34:45 +00:00
parent 8476e4a59f
commit 685a8bca84
51 changed files with 2354 additions and 226 deletions
+27
View File
@@ -0,0 +1,27 @@
import { decideLandingGuard } from '../../frontend/src/app/core/guards/landing.guard.decision';
describe('decideLandingGuard', () => {
const router = {
createUrlTree: jest.fn((commands: string[]) => ({ kind: 'UrlTree', commands })),
};
beforeEach(() => {
(router.createUrlTree as jest.Mock).mockClear();
});
it('redirects to /bootstrap when not initialized', () => {
const r = decideLandingGuard({ initialized: false, isAuthenticated: false }, router as any);
expect(router.createUrlTree).toHaveBeenCalledWith(['/bootstrap']);
expect((r as any).commands).toEqual(['/bootstrap']);
});
it('redirects to / when initialized and authenticated', () => {
const r = decideLandingGuard({ initialized: true, isAuthenticated: true }, router as any);
expect(router.createUrlTree).toHaveBeenCalledWith(['/']);
expect((r as any).commands).toEqual(['/']);
});
it('allows when initialized and not authenticated', () => {
expect(decideLandingGuard({ initialized: true, isAuthenticated: false }, router as any)).toBe(true);
});
});