feat(voyage): implement screenshots-spor convention (window.__hooks + docs/screenshots/)
This commit is contained in:
parent
b70b480d0d
commit
e839ba2a7a
3 changed files with 179 additions and 0 deletions
|
|
@ -382,3 +382,34 @@ test('voyage-playground.html declares wireA11yToggle JS function (v4.3 Step 22)'
|
|||
assert.match(text, /panel\.hidden\s*=\s*!willOpen/, 'panel.hidden toggle required');
|
||||
assert.match(text, /setAttribute\('aria-expanded'/, 'aria-expanded update required');
|
||||
});
|
||||
|
||||
// v4.3 Step 23 — screenshots-spor convention (window.__hooks + docs/screenshots/)
|
||||
test('voyage-playground.html exposes window.__voyage automation hooks (v4.3 Step 23)', () => {
|
||||
const text = readFileSync(HTML, 'utf-8');
|
||||
// window.__voyage must be assigned (object literal or assignment expression)
|
||||
assert.match(text, /window\.__voyage\s*=\s*\{/, 'window.__voyage = { ... } assignment required');
|
||||
});
|
||||
|
||||
test('voyage-playground.html window.__voyage exposes navigate/scheduleRender/getProjectArtifacts (v4.3 Step 23)', () => {
|
||||
const text = readFileSync(HTML, 'utf-8');
|
||||
// Each method must appear as a property of the exposed object.
|
||||
assert.match(text, /navigate:\s*function/, 'navigate method required');
|
||||
assert.match(text, /scheduleRender:\s*function/, 'scheduleRender method required');
|
||||
assert.match(text, /getProjectArtifacts:\s*function/, 'getProjectArtifacts method required');
|
||||
});
|
||||
|
||||
test('docs/screenshots/README.md documents mappestruktur + hooks (v4.3 Step 23)', () => {
|
||||
const path = join(ROOT, 'docs', 'screenshots', 'README.md');
|
||||
const text = readFileSync(path, 'utf-8');
|
||||
assert.match(text, /Mappestruktur/, 'Mappestruktur heading required');
|
||||
// Must list each documented subfolder
|
||||
assert.match(text, /dashboard\//, 'dashboard/ subfolder documented');
|
||||
assert.match(text, /artifact-detail\//, 'artifact-detail/ subfolder documented');
|
||||
assert.match(text, /annotation\//, 'annotation/ subfolder documented');
|
||||
assert.match(text, /dark-mode\//, 'dark-mode/ subfolder documented');
|
||||
assert.match(text, /light-mode\//, 'light-mode/ subfolder documented');
|
||||
// Hooks documentation must reference all three methods
|
||||
assert.match(text, /window\.__voyage\.navigate/, 'navigate hook documented');
|
||||
assert.match(text, /window\.__voyage\.scheduleRender/, 'scheduleRender hook documented');
|
||||
assert.match(text, /window\.__voyage\.getProjectArtifacts/, 'getProjectArtifacts hook documented');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue