Repository navigation
test(vibe-tests): guest fixture token pairs meet contrast without a browser - #8889
Merged
Merged
Conversation
…rowser The guest subtree of the enterprise fixture redefines generic token names. Each text-on-surface pair that fixtures:contrast measures in a real browser is now checked in the unit suite from the token values in the fixture's CSS, so a palette change that drops a pair below 4.5:1 fails without Playwright. The browser check keeps what only rendering shows: the cascade resolving those values at every boundary.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Looks good to merge: the new unit test checks the same seven guest pairs as fixtures:contrast, its ratios match what the browser step measures in light and dark mode, and the documented --subtle: #8b5cf6 edit fails the four pairs that use it. One optional wording fix for the description: fixture-contrast runs alongside test-node in CI rather than after it, so the gain is fast, browserless feedback rather than lower CI cost.
[Automated review]
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who this helps: contributors who change the enterprise fixture's guest palette. A text-on-surface pair that drops below 4.5:1 now fails in the Node unit suite in seconds. Before, the only place it failed was the Playwright step, which renders the fixture in a browser.
What changes
internal/vibe-tests/src/guest-token-contrast.test.mjsreads the guest token block ([data-guest-design-system]) from the fixture'sindex.css. It computes WCAG contrast for each pair the browser check measures:CONTRAST_PROBESinfixture-browser.mjs: a new browser probe without a pair fails.fixtures:contrast) is unchanged. It still owns what only rendering shows: the cascade resolving these values at every boundary.Line count
+117 / −0, net +117. It's net positive because it's a new unit test with nothing to delete: the browser check stays as the cascade check. CI cost goes down, not up, because a palette regression now fails in the unit suite before any browser job runs.
Testing
vitest run --project node internal/vibe-tests/src/guest-token-contrast.test.mjs: 8 pass.--subtleset to#8b5cf6, 4 pairs fail (both callouts, the dialog callout, menu hover). Restoring it passes.