fix(voyage): resolve 4 color-contrast WCAG violations in light theme (09132940)
This commit is contained in:
parent
48ab3c9de3
commit
4910999198
2 changed files with 33 additions and 0 deletions
|
|
@ -120,6 +120,31 @@ test.describe('voyage-playground a11y (axe-core)', () => {
|
|||
expect(grownRules, `GROWN rule-counts vs baseline: ${JSON.stringify(grownRules, null, 2)}`).toEqual([]);
|
||||
});
|
||||
|
||||
// v4.3 Step 4 — DIAGNOSTIC test (removed in Step 5/Wave 3). Prints the
|
||||
// node selectors flagged by color-contrast so we can target scoped CSS
|
||||
// overrides at exactly those nodes (finding 09132940).
|
||||
// Asserts ZERO color-contrast violations after the inline-style override
|
||||
// is applied — passes only when remediation is complete.
|
||||
test('DIAGNOSTIC — print color-contrast node selectors (09132940)', async ({ page }) => {
|
||||
await page.goto('voyage-playground.html');
|
||||
await page.evaluate(() => {
|
||||
window.localStorage.setItem('voyage-theme', 'light');
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
document.documentElement.style.colorScheme = 'light';
|
||||
});
|
||||
await page.reload();
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
const results = await new AxeBuilder({ page })
|
||||
.options({ runOnly: ['color-contrast'] })
|
||||
.analyze();
|
||||
const nodes = results.violations.flatMap((v) =>
|
||||
v.nodes.map((n) => ({ rule: v.id, target: n.target, html: (n.html || '').slice(0, 80) })),
|
||||
);
|
||||
// Diagnostic emission — visible via --reporter=line
|
||||
console.log('[DIAGNOSTIC color-contrast nodes]', JSON.stringify(nodes));
|
||||
expect(nodes, `color-contrast violations remain: ${JSON.stringify(nodes, null, 2)}`).toEqual([]);
|
||||
});
|
||||
|
||||
test('pixel-diff smoke 1280×900 — light + dark within 2% threshold (SC1 backup)', async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
// Light theme baseline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue