AI Implementation feature(841): First-Start Create Admin Modal 1.00 (#3)

This commit was merged in pull request #3.
This commit is contained in:
2026-07-21 15:07:44 +00:00
parent 9f67ec8c50
commit 960516a7bc
18 changed files with 518 additions and 112 deletions
+27
View File
@@ -0,0 +1,27 @@
import { decideAdminGuard } from '../../frontend/src/app/core/guards/admin.guard.decision';
describe('decideAdminGuard', () => {
it('redirects to /bootstrap when not initialized', () => {
expect(
decideAdminGuard({ initialized: false, isAuthenticated: true, role: 'admin' }),
).toEqual({ kind: 'redirect', path: '/bootstrap' });
});
it('redirects to /login when not authenticated', () => {
expect(
decideAdminGuard({ initialized: true, isAuthenticated: false, role: undefined }),
).toEqual({ kind: 'redirect', path: '/login' });
});
it('redirects to / when authenticated but not admin', () => {
expect(
decideAdminGuard({ initialized: true, isAuthenticated: true, role: 'player' }),
).toEqual({ kind: 'redirect', path: '/' });
});
it('allows when authenticated admin', () => {
expect(
decideAdminGuard({ initialized: true, isAuthenticated: true, role: 'admin' }),
).toEqual({ kind: 'allow' });
});
});