feat: Landing Page and Login/Register Modal

This commit is contained in:
OpenVelo Agent
2026-07-21 18:34:42 +00:00
parent 09856ccf8e
commit 0126f6ad39
37 changed files with 1791 additions and 210 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);
});
});