import { authGuard } from '@task-stream/web/identity/presenters'; import { appRoutes } from './app.routes'; describe('appRoutes', () => { it('keeps home behind the auth guard, and public projects and «Explorar» open', () => { const paths = appRoutes.map((route) => route.path); expect(paths).toEqual( expect.arrayContaining(['login', 'auth/callback', '', '**']), ); const app = appRoutes.find((route) => route.path === '' && route.children); const children = app?.children ?? []; expect(children.map((route) => route.path)).toEqual([ '', 'explorar', 'p/:key', ]); expect(children[0].canActivate).toContain(authGuard); expect(children[1].canActivate).toBeUndefined(); expect(children[2].canActivate).toBeUndefined(); }); it('exposes every project section', () => { const project = appRoutes .find((route) => route.path === '') ?.children?.find((route) => route.path === 'p/:key'); expect(project?.children?.map((route) => route.path)).toEqual([ '', 'board', 'issues/:issueKey', 'backlog', 'epics', 'releases', 'dashboard', 'analytics', 'settings', 'activity', 'members', ]); }); });