chore(tabs): add VRT coverage - #6621
Conversation
|
📚 Branch Preview Links🔍 Gen1 Visual Regression Test ResultsWhen 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: If the changes are expected, update the |
440bbe4 to
c84ce63
Compare
rise-erpelding
left a comment
There was a problem hiding this comment.
A few tiny questions/suggestions, but overall looks good!
c84ce63 to
4b645fd
Compare
Ended up dropping in a change here 285921f based on @rise-erpelding's feedback that touched on the same spot in the code. ✨ |
@aramos-adobe I think this is a valid concern, in a real use case focus-visible would always happen when a tab is also selected... @cdransf Would we want to change the forced states so that the first selected tab is actually a focus visible instead? Claude did bring up the concern that we're not testing selected + hover, but I think that may be overkill for this component, because the only hover effect is a text color change, and it's the same color change that selected gets. But could be a valid thing to look out for in other components! |


Description
Adds
2nd-gen/packages/swc/components/tabs/test/vrt/tabs.vrt.tsandtabs-custom-properties.vrt.ts, providing dedicated Chromatic VRT coverage for thetabsthree-element component (swc-tabs,swc-tab,swc-tab-panel):Permutations: direction (horizontal/vertical) x density (regular/compact), individual tab states (default/selected/disabled), a fully disabled container, anatomy (text-only/icon+text/icon-only), forced hover/focus-visible/active on individual tabs, and CJK tab labels (ja/ko/zh).ForcedColors: the same permutation set under forced-colors emulation, covering the forced-colors overrides defined on all three parts of the architecture.CustomProperties: one reference/override row per documented custom property, split into two groups (Tabs, Tab) and verified against the manifest for each of the two declarations independently.TabPanelhas no documented@cssprop(the--swc-tab-panel-padding-topits CSS uses isn't part of its public API contract), so it has no custom-properties row here - that's expected, not a gap.This PR touches only files under
components/tabs/test/vrt/- no component source and no shared.storybook/helperschanges. (An earlier version of this PR also documented a missing@cssproponTabPanel.tsand re-added a shared VRT caption helper; both were reverted to keep this change scoped purely to test coverage fortabs, per review discussion.)Motivation and context
The
tabscomponent had no dedicated VRT coverage. This follows the VRT foundation established forbutton(PR #6463), extending it totabsper the linked ticket.The ticket's acceptance criteria asked for a "quiet variant" snapshot, but
swc-tabshas noquietproperty - it was explicitly removed in the 2nd-gen migration (migration-guide.mdx: "No replacement; not part of Spectrum 2 surface"). Substituteddensity(regular/compact) instead, since that's the actual replacement axis for the removed quiet treatment.Related issue(s)
Screenshots (if appropriate)
N/A - test-only change, no visual/behavioral change to the components themselves. Manually verified via Playwright screenshots of the built Storybook (including real
forced-colorsmedia emulation, not just the inert Chromatic parameter) during development; a nesting bug in the custom-properties layout was caught and fixed this way before landing.Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Permutations,ForcedColors, andCustomPropertiesstoriesDevice review
Accessibility testing checklist
Keyboard
These are non-interactive VRT snapshot fixtures (tagged
dev, excluded from the interactive Storybook sidebar in normal use); no new keyboard behavior is introduced. Confirm no regressions in the existingtabs.stories.tsdocs examples' keyboard navigation (arrow keys, Home/End, Enter/Space activation).Screen reader
aria-label(e.g. "Dashboard"), the disabled tab to announce as unavailable, and the selected tab to announcearia-selected="true"