test(playground): require every inlined demo report to equal its fixture
The demo block is output of scripts/build-demo-state.mjs, so each inlined report must equal playground/test-fixtures/<id>.md. Red on 70731af: classify, requirements, conformity, review, adr and summary differ. The block carries the corrected AI Act deadlines while the fixtures still carry 2027-08-02, so the next rebuild would silently put the old dates back in the demo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
820d62ddb4
commit
d670e7b3ee
1 changed files with 11 additions and 0 deletions
|
|
@ -62,6 +62,17 @@ test('the demo project description names the domain its reports are about', () =
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// The demo block is build output: every inlined report must equal its fixture.
|
||||||
|
// A block edited in place while the fixture kept older text is a demo that the
|
||||||
|
// next rebuild silently reverts.
|
||||||
|
test('every inlined demo report equals its fixture', () => {
|
||||||
|
const { reports } = demoProject();
|
||||||
|
const stale = Object.entries(reports)
|
||||||
|
.filter(([id, r]) => readFileSync(`${pluginRoot}playground/test-fixtures/${id}.md`, 'utf8') !== r.raw_markdown)
|
||||||
|
.map(([id]) => id);
|
||||||
|
assert.deepEqual(stale, [], `inlined reports differ from playground/test-fixtures/: ${stale.join(', ')}`);
|
||||||
|
});
|
||||||
|
|
||||||
test('the inlined demo project description matches the build script', () => {
|
test('the inlined demo project description matches the build script', () => {
|
||||||
const { description } = demoProject();
|
const { description } = demoProject();
|
||||||
const source = readFileSync(pluginRoot + BUILD_SCRIPT, 'utf8');
|
const source = readFileSync(pluginRoot + BUILD_SCRIPT, 'utf8');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue