(items: NavigationItem[])
| 35 | it('should only redirect to paths that exist', () => { |
| 36 | const knownPaths = new Set<string>(); |
| 37 | const collectPaths = (items: NavigationItem[]) => { |
| 38 | for (const item of items) { |
| 39 | if (item.path) { |
| 40 | knownPaths.add(item.path); |
| 41 | } |
| 42 | if (item.children) { |
| 43 | collectPaths(item.children); |
| 44 | } |
| 45 | } |
| 46 | }; |
| 47 | collectPaths(ALL_ITEMS); |
| 48 | // Landing pages such as the playground are routed directly, not through the navigation. |
| 49 | for (const page of Object.values(DEFAULT_PAGES)) { |