diff --git a/tests/unit/ds4Billboards.test.js b/tests/unit/ds4Billboards.test.js index ddae892..6cc20d3 100644 --- a/tests/unit/ds4Billboards.test.js +++ b/tests/unit/ds4Billboards.test.js @@ -107,11 +107,13 @@ describe('GradeResultCard — the letter is hero, edge is sign-colored', () => { const src = read('components/vyndr/GradeResultCard.tsx'); test('a negative edge NEVER renders green — negative = var(--miss)', () => { - expect(src).toMatch(/edgeColor\s*=\s*d\.edge != null && d\.edge < 0 \? 'var\(--miss\)' : 'var\(--g-a\)'/); - // both the confidence strip and the projection row use edgeColor, not a - // hardcoded green. - expect(src).toContain('color: edgeColor'); - expect(src).toMatch(/d\.edge != null \? edgeColor : 'var\(--text-2\)'/); + // DS3 superseded DS4's local const with the centralized colorContract + // enforcer — same semantics (negative → var(--miss)), now via the shared + // helper. Both the confidence strip and the projection row route edge + // through edgeColor(d.edge), never a hardcoded green. + expect(src).toMatch(/import \{ edgeColor.*\} from '@\/lib\/colorContract'/); + expect(src).toContain('color: edgeColor(d.edge)'); + expect(src).toMatch(/d\.edge != null \? edgeColor\(d\.edge\) : 'var\(--text-2\)'/); }); test('the grade LETTER is still the hero (largest element)', () => {