fix: make Target canonical and place Roadmap second
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
9651417ba7
commit
baf79e125b
15 files changed
+125
-72
No files matched your search
@@ -125,8 +125,10 @@ const fs = require('node:fs');
|
||||
await page.screenshot({path:`${output}/${width}.png`, fullPage:true});
|
||||
await frame.locator('#btn-theme').click(); await theme('dark');
|
||||
// Exercise keyboard navigation without racing the portal's smooth scroll.
|
||||
await page.locator('.strategy-content a[href$="/strategy/target-operating-model/"]').filter({visible:true}).focus();
|
||||
await page.locator('.strategy-content a[href$="/strategy/skills-governance/"]').filter({visible:true}).focus();
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForURL('**/strategy/skills-governance/');
|
||||
await page.goBack({waitUntil:'domcontentloaded'});
|
||||
await page.waitForURL('**/strategy/target-operating-model/');
|
||||
await page.getByRole('heading', {name:'Target operating model', exact:true, level:1}).waitFor();
|
||||
const next = page.locator(`.archify-panel--story[data-diagram="strategy-target"] > .story-${width > 700 ? 'desktop' : 'mobile'}`);
|
||||
|
||||
@@ -19,7 +19,20 @@ const fs = require('node:fs');
|
||||
await page.waitForURL('**/strategy/target-operating-model/');
|
||||
for (const route of ['target-operating-model/', '']) {
|
||||
await page.goto(`${base}/eldorado-v1/documentation/strategy/${route}`, {waitUntil:'networkidle'});
|
||||
if (width === 1440) assert.equal(await page.locator('.theme-doc-sidebar-menu .menu__link').first().innerText(), 'Target');
|
||||
await page.waitForURL('**/strategy/target-operating-model/');
|
||||
if (width < 700) await page.getByRole('button', {name:'Toggle navigation bar'}).click();
|
||||
const menu = page.locator('.theme-doc-sidebar-menu .menu__link').filter({visible:true});
|
||||
await menu.first().waitFor({state:'visible'});
|
||||
assert.deepEqual(await menu.allTextContents(), ['Target', 'Roadmap', 'Skills governance', 'Skills quality', 'Skills adoption', 'Measurement', 'Skills maintenance']);
|
||||
assert((await menu.nth(0).getAttribute('href')).endsWith('/strategy/target-operating-model/'));
|
||||
assert((await menu.nth(1).getAttribute('href')).endsWith('/strategy/roadmap/'));
|
||||
assert.equal(await menu.filter({hasText:/^Target$/}).count(), 1);
|
||||
await page.screenshot({path:`${output}/${width}-${route ? 'target' : 'landing'}-navigation.png`,fullPage:true,animations:'disabled'});
|
||||
await menu.nth(1).click();
|
||||
await page.waitForURL('**/strategy/roadmap/');
|
||||
await page.getByRole('heading', {level:1,name:'Roadmap',exact:true}).waitFor();
|
||||
await page.goBack({waitUntil:'domcontentloaded'});
|
||||
await page.waitForURL('**/strategy/target-operating-model/');
|
||||
const iframe = page.locator(`.archify-panel--story > .story-${width > 700 ? 'desktop' : 'mobile'}`);
|
||||
await iframe.scrollIntoViewIfNeeded();
|
||||
const frame = await (await iframe.elementHandle()).contentFrame();
|
||||
|
||||
@@ -4,10 +4,10 @@ import {readFileSync} from 'node:fs';
|
||||
const read = p => readFileSync(p, 'utf8');
|
||||
const stages = ['Scope', 'Architecture', 'UI/UX', 'Planning', 'Delivery', 'UAT', 'Security', 'Releases'];
|
||||
|
||||
test('Strategy opens at the autonomous lifecycle, with a matching direct landing story', () => {
|
||||
assert.match(read('sidebars/strategy.ts'), /strategySidebar: \['target-operating-model', 'index'/);
|
||||
test('Strategy opens at the canonical autonomous lifecycle', () => {
|
||||
assert.match(read('sidebars/strategy.ts'), /strategySidebar: \['target-operating-model', 'roadmap'/);
|
||||
assert.match(read('docs/strategy/target-operating-model.mdx'), /^sidebar_label: Target$/m);
|
||||
for (const id of ['index', 'target-operating-model']) {
|
||||
for (const id of ['target-operating-model']) {
|
||||
const page = read(`docs/strategy/${id}.mdx`);
|
||||
const primary = page.split('<details>')[0];
|
||||
assert(primary.includes('name="strategy-target"'));
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import {test} from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {readFileSync, existsSync} from 'node:fs';
|
||||
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);
|
||||
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('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'/);
|
||||
assert.match(read('docusaurus.config.ts'), /from: '\/strategy\/', to: '\/strategy\/target-operating-model\/'/);
|
||||
});
|
||||
@@ -3,9 +3,9 @@ import assert from 'node:assert/strict';
|
||||
import {readFileSync, readdirSync} from 'node:fs';
|
||||
const read = p => readFileSync(p, 'utf8');
|
||||
const model = JSON.parse(read('research/ai-adoption/strategy-model.json'));
|
||||
test('eight fixed strategy pages preserve target boundary and separate evidence', () => {
|
||||
assert.equal(model.pages.length, 8);
|
||||
assert.equal(readdirSync('docs/strategy').length, 8);
|
||||
test('seven canonical strategy pages preserve target boundary and separate evidence', () => {
|
||||
assert.equal(model.pages.length, 7);
|
||||
assert.equal(readdirSync('docs/strategy').length, 7);
|
||||
for (const {id} of model.pages) {
|
||||
const page = read(`docs/strategy/${id}.mdx`);
|
||||
assert(page.includes(`id: ${id}`));
|
||||
|
||||
@@ -18,6 +18,9 @@ assert(workflow.includes("gitea.event_name == 'push' && gitea.ref == 'refs/heads
|
||||
if (process.argv.includes('--build')) {
|
||||
const model = JSON.parse(read('research/ai-adoption/strategy-model.json'));
|
||||
const indexes = readdirSync('build').filter(f => /^search-index.*\.json$/.test(f)).map(f => read(join('build',f))).join('\n');
|
||||
const redirect = read('build/strategy/index.html');
|
||||
assert(redirect.includes('/eldorado-v1/documentation/strategy/target-operating-model/'));
|
||||
assert(redirect.includes('window.location.href') && redirect.includes('http-equiv="refresh"') && !redirect.includes('archify-panel'), 'Landing must redirect, not duplicate Target');
|
||||
for (const {id, title} of model.pages) {
|
||||
const route = `strategy/${id === 'index' ? '' : `${id}/`}index.html`;
|
||||
const page = read(join('build',route));
|
||||
|
||||
Reference in new issue
Block a user