test: point the review-desk assertions at what the build emits
Two of task 19's re-pointed assertions were checking the built page for tokens only the legacy page has, and both were hidden behind the full-guide snapshot failure because verify.mjs stops at the first throw. - The catalog count looked for `data-skill-id=`, which the desk's island writes at runtime. Count the entries in the inline JSON payload the page actually ships instead. Still 24. - The vote-widget CSS check looked for `[aria-pressed="true"]`; the minifier drops the quotes, so the built sheet carries `[aria-pressed=true]`. Match either form. Also re-baselines the full-guide rendered-text snapshot. It had been taken from the build as it stood, which was the build missing a fifth of the page, so it pinned the regression rather than the contract. The new baseline is the build task 15f restored, verified against the legacy page by .agents/scripts/rendered-text-diff.mjs: en 432/432 and pt 431/431, missing 0, extra 0, order clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+7
-4
@@ -360,7 +360,9 @@ if (
|
||||
)
|
||||
)
|
||||
throw new Error('missing review file-manifest contract');
|
||||
if ((html.review.match(/data-skill-id=/g) || []).length !== 24)
|
||||
// The desk renders its cards from an inline JSON payload, so `data-skill-id`
|
||||
// only exists after the island runs. Count the entries in the payload instead.
|
||||
if ((html.review.match(/\\"id\\":/g) || []).length !== 24)
|
||||
throw new Error('review catalog no longer covers all submissions');
|
||||
if (!source.ndoReview.includes('safety-redacted') || !reviewAsset.includes('[REDACTED]'))
|
||||
throw new Error('review catalog lost its secret-safety contract');
|
||||
@@ -437,10 +439,11 @@ if (
|
||||
)
|
||||
)
|
||||
throw new Error('review vote-widget contract missing');
|
||||
// The CSS minifier drops the attribute value's quotes, so the built sheet
|
||||
// carries `[aria-pressed=true]`. Match either form.
|
||||
if (
|
||||
!['.vote-widget', '.vote-buttons', '[aria-pressed="true"]'].every((token) =>
|
||||
builtCss.includes(token),
|
||||
)
|
||||
!['.vote-widget', '.vote-buttons'].every((token) => builtCss.includes(token)) ||
|
||||
!/\[aria-pressed=["']?true["']?\]/.test(builtCss)
|
||||
)
|
||||
throw new Error('review vote-widget CSS contract missing');
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user