| 1234567891011121314151617181920212223242526 |
- import { routes } from '../app.routes';
- import { PAGE_CATALOG } from './page-catalog';
- describe('migration route catalog', () => {
- it('contains all 95 legacy routes exactly once', () => {
- expect(PAGE_CATALOG.length).toBe(95);
- expect(new Set(PAGE_CATALOG.map((page) => page.path)).size).toBe(95);
- });
- it('registers every catalog entry in Angular Router', () => {
- const children = routes.find((route) => route.children?.some((child) => child.path === 'pages/home/index'))?.children ?? [];
- const routePaths = new Set(children.map((route) => route.path));
- for (const page of PAGE_CATALOG) expect(routePaths.has(page.path)).withContext(page.path).toBeTrue();
- });
- it('keeps usable metadata on every route', () => {
- for (const page of PAGE_CATALOG) {
- expect(page.path).withContext('path').toMatch(/^(pages|components)\//);
- expect(page.title.length).withContext(page.path).toBeGreaterThan(0);
- if (page.kind === 'form') {
- expect(page.fields?.length).withContext(`${page.path} fields`).toBeGreaterThan(0);
- expect(page.saveAction).withContext(`${page.path} save action`).toBeTruthy();
- }
- }
- });
- });
|