Skip to content

chore(opacity-checkerboard): add vrt coverage - #6619

Merged
pfulton merged 1 commit into
mainfrom
cdransf/opacity-checkerboard-vrt-coverage
Aug 14, 2026
Merged

chore(opacity-checkerboard): add vrt coverage#6619
pfulton merged 1 commit into
mainfrom
cdransf/opacity-checkerboard-vrt-coverage

Conversation

@cdransf

@cdransf cdransf commented Aug 13, 2026

Copy link
Copy Markdown
Member

Description

Adds dedicated test/vrt/ coverage for the opacity-checkerboard shared CSS utility, following the button VRT pattern: opacity-checkerboard.vrt.ts covers size (m/s) across light/dark themes (the alternating square resolves one color via light-dark(), so dark theme is a real visual axis, not just a direction check), plus representative transparent-content fills, and a ForcedColors story covers the forced-color-adjust: none override; opacity-checkerboard-custom-properties.vrt.ts covers reference/override rows for the two exposed custom properties (--swc-opacity-checkerboard-square-dark-light/-dark-dark), each rendered in the color-scheme where it actually applies. No global-styles VRT file is included since this utility has no plain-class global stylesheet to cover. Also extracts the internal demo host (demo-opacity-checkerboard-swatch) and its swatch() helper out of the docs .stories.ts file into a shared module so both the docs and VRT stories use one implementation instead of two copies.

Motivation and context

Closes the VRT coverage gap for opacity-checkerboard called out in SWC-2422.

Related issue(s)

  • Jira: SWC-2422

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature.
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Accessibility testing checklist

  • Keyboard: N/A. Visual-only test coverage; no focusable parts, no interactive changes. Open Storybook → Opacity checkerboard → Opacity checkerboard VRT, press Tab through each story, and expect no element to receive focus since the pattern is decorative only.
  • Screen reader: No accessibility-relevant changes. The demo host's existing role="img" + aria-label on the swatch, and aria-hidden="true" on the checkerboard layer, are untouched. Open Storybook → Opacity checkerboard → Opacity checkerboard VRT with VoiceOver/NVDA active, navigate to a swatch, and expect it to announce as an image with its label while the checkerboard layer itself is never announced.

@cdransf
cdransf requested a review from a team as a code owner August 13, 2026 19:23
@cdransf cdransf self-assigned this Aug 13, 2026
@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 77f56ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cdransf cdransf added Spectrum 2 Issues related to Spectrum 2 Status:Ready for review PR ready for review or re-review. labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6619

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@pfulton pfulton added the run_vrt Triggers the Chromatic VRT run for 2nd-gen label Aug 13, 2026

@pfulton pfulton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me! I left a comment about the suggested change to the demo component, but I'm fine with whatever y'all decide to do on that.

@cdransf
cdransf force-pushed the cdransf/opacity-checkerboard-vrt-coverage branch from d6e7cc0 to 77f56ec Compare August 13, 2026 21:10
@cdransf
cdransf requested a review from pfulton August 13, 2026 21:11
@cdransf

cdransf commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Seems good to me! I left a comment about the suggested change to the demo component, but I'm fine with whatever y'all decide to do on that.

All set and reverted. ✨

@pfulton pfulton added Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge and removed Status:Ready for review PR ready for review or re-review. labels Aug 14, 2026
@pfulton
pfulton merged commit c0ca984 into main Aug 14, 2026
35 checks passed
@pfulton
pfulton deleted the cdransf/opacity-checkerboard-vrt-coverage branch August 14, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_vrt Triggers the Chromatic VRT run for 2nd-gen Spectrum 2 Issues related to Spectrum 2 Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants