docs: [verified] group Strategy into adoption and autonomy stages
Build and publish Eldorado documentation / build (pull_request) Successful in 40s
Build and publish Eldorado documentation / build (pull_request) Successful in 40s
This commit is contained in:
1 parent
8a7dbea852
commit
fe4c3509d1
17 files changed
+218
-21
No files matched your search
@@ -1,17 +1,46 @@
|
||||
import {test} from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {readFileSync, existsSync} from 'node:fs';
|
||||
import {runInNewContext} from 'node:vm';
|
||||
import ts from 'typescript';
|
||||
const read = p => readFileSync(p, 'utf8');
|
||||
|
||||
test('Strategy has one canonical Target, then Roadmap, without a landing menu duplicate', () => {
|
||||
const sidebar = read('sidebars/strategy.ts').split('strategySidebar: [')[1].split(']')[0];
|
||||
const ids = [...sidebar.matchAll(/'([^']+)'/g)].map(match => match[1]);
|
||||
assert.deepEqual(ids, ['target-operating-model', 'roadmap', 'skills-governance', 'skills-quality', 'skills-adoption', 'measurement', 'skills-maintenance']);
|
||||
assert.equal(ids.filter(id => id === 'target-operating-model').length, 1);
|
||||
test('Strategy has Target, Roadmap, a linked Skills Adoption category and Autonomous Agent', () => {
|
||||
const compiled = ts.transpileModule(read('sidebars/strategy.ts'), {compilerOptions:{module:ts.ModuleKind.CommonJS}}).outputText;
|
||||
const sandbox = {exports:{}};
|
||||
runInNewContext(compiled, sandbox);
|
||||
const sidebar = JSON.parse(JSON.stringify(sandbox.exports.default.strategySidebar));
|
||||
assert.deepEqual(sidebar, ['target-operating-model', 'roadmap', {
|
||||
type:'category', label:'Stage - 01 - Skills Adoption',
|
||||
link:{type:'doc', id:'stage-01-skills-adoption'}, collapsed:true,
|
||||
items:[
|
||||
{type:'doc', id:'skills-governance', label:'Governance'},
|
||||
{type:'doc', id:'skills-quality', label:'Quality'},
|
||||
{type:'doc', id:'skills-adoption', label:'Adoption'},
|
||||
{type:'doc', id:'measurement', label:'Measurement'},
|
||||
{type:'doc', id:'skills-maintenance', label:'Maintenance'},
|
||||
],
|
||||
}, 'stage-02-autonomous-agent']);
|
||||
assert.match(read('docs/strategy/target-operating-model.mdx'), /^sidebar_label: Target$/m);
|
||||
assert.match(read('docusaurus.config.ts'), /type: 'docSidebar', docsPluginId: 'strategy', sidebarId: 'strategySidebar', label: 'Strategy'/);
|
||||
});
|
||||
|
||||
test('stage overviews explain the foundation and future without replacing topic content', () => {
|
||||
const first = read('docs/strategy/stage-01-skills-adoption.mdx');
|
||||
const second = read('docs/strategy/stage-02-autonomous-agent.mdx');
|
||||
for (const [id, title, page] of [
|
||||
['stage-01-skills-adoption', 'Stage - 01 - Skills Adoption', first],
|
||||
['stage-02-autonomous-agent', 'Stage - 02 - Autonomous Agent', second],
|
||||
]) {
|
||||
assert(page.includes(`id: ${id}\ntitle: ${title}`));
|
||||
for (const link of ['./roadmap.mdx', './target-operating-model.mdx']) assert(page.includes(link));
|
||||
}
|
||||
for (const id of ['skills-governance','skills-quality','skills-adoption','measurement','skills-maintenance']) assert(first.includes(`./${id}.mdx`));
|
||||
for (const marker of ['human + AI Agent','Delivery first','order is not yet decided','KPIs','baseline','topology','feedback','new current situation']) assert(first.includes(marker), marker);
|
||||
for (const marker of ['future','proven skills','measurements','working practices','direction and review','not deployed autonomy','approved KPI thresholds']) assert(second.includes(marker), marker);
|
||||
assert.match(read('docs/strategy/measurement.mdx'), /^title: Skills Measurement\nsidebar_label: Measurement$/m);
|
||||
});
|
||||
|
||||
test('old Strategy entry redirects to Target instead of maintaining a second document', () => {
|
||||
assert(!existsSync('docs/strategy/index.mdx'));
|
||||
assert.match(read('docusaurus.config.ts'), /'@docusaurus\/plugin-client-redirects'/);
|
||||
|
||||
Reference in new issue
Block a user