import test from 'node:test'; import assert from 'node:assert/strict'; import {readFileSync, existsSync} from 'node:fs'; const read = (path) => readFileSync(path, 'utf8'); test('portal identity and exact navigation contract', () => { const config = read('docusaurus.config.ts'); assert.match(config, /title: '3D Architecture Wizzard'/); assert.match(config, /baseUrl: '\/corp-v1-3darch\/corp-v1-3darch-documentation\/'/); const labels = [...config.matchAll(/label: '(User Tutorial|Scope|Architecture|Kanban|Ways Of Working|Engineering|Glossary)'/g)].map(m=>m[1]); assert.deepEqual(labels.slice(0,7), ['User Tutorial','Scope','Architecture','Kanban','Ways Of Working','Engineering','Glossary']); assert.ok(config.includes("hashed: 'filename'")); }); test('each area has a dedicated sidebar and required ordering', () => { for (const file of ['sidebars.ts','sidebarsScope.ts','sidebarsArchitecture.ts','sidebarsKanban.ts','sidebarsWaysOfWorking.ts','sidebarsEngineering.ts','sidebarsGlossary.ts']) assert.ok(existsSync(file), file); assert.ok(read('sidebarsKanban.ts').indexOf("'board'") < read('sidebarsKanban.ts').indexOf("'focus'")); assert.ok(read('sidebarsGlossary.ts').indexOf("'terms'") < read('sidebarsGlossary.ts').indexOf("'project-language'")); }); test('homepage publishes the required delivery record', () => { const home = read('src/pages/index.tsx'); for (const marker of ['3DARCH-PORTAL-KICKOFF-2026-08-31','interactive 3D application','Navigable browser POC','Linas ยท 3darch team','Application repository','Board record','README','Project skill']) assert.ok(home.includes(marker), marker); }); test('sharp light and dark UI contract is explicit', () => { const css = read('src/css/custom.css'); assert.match(css, /\*,\*::before,\*::after\{border-radius:0!important\}/); assert.match(css, /\[data-theme='dark'\]/); }); test('approved Epic catalogue is complete, governed, and reader-linked', () => { const sidebar = read('sidebarsScope.ts'); const overview = read('scope/overview.md'); const roadmap = read('scope/roadmap.md'); const matrix = read('src/data/scopeIssues.ts'); assert.ok(sidebar.indexOf("'overview'") < sidebar.indexOf("'roadmap'")); assert.ok(sidebar.indexOf("label: 'Ideas'") < sidebar.indexOf("label: 'Questions'")); assert.ok(sidebar.indexOf("label: 'Questions'") < sidebar.indexOf("label: 'Epics'")); assert.match(overview, //); assert.match(roadmap, /All Epics remain in `IN_BACKLOG`/); for (let number = 1; number <= 10; number += 1) { const id = `3DARCH-EP-${number}`; const slug = id.toLowerCase(); assert.ok(existsSync(`data/scope/epics/${slug}.yml`), id); assert.ok(existsSync(`scope/epics/${slug}.md`), id); assert.ok(existsSync(`scope/epics/${slug}/features.md`), `${id} Features group`); const record = JSON.parse(read(`data/scope/epics/${slug}.yml`)); assert.equal(record.id, id); assert.equal(record.status, 'IN_BACKLOG'); assert.equal(record.status_source, 'EXACT'); assert.equal(record.approval.approved_for_solution, false); assert.ok(record.legacy_evidence.length > 0); assert.ok(matrix.includes(`\"id\": \"${id}\"`)); } assert.doesNotMatch(matrix, /type: \"Feature\"|type: \"Task\"|type: \"Idea\"/); });