test(infield-button): add complete test suites for Phase 6#6502
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 |
9303195 to
8375937
Compare
37d81f7 to
ecb2ac1
Compare
9340367 to
0ac6722
Compare
c9b6906 to
e003b59
Compare
9f5d5c8 to
0856170
Compare
Adds infield-button.test.ts (13 Storybook/Vitest play-function stories covering defaults, property reflection, slots, sizes, quiet variant, states, behaviors, and dev-mode warnings) and infield-button.a11y.spec.ts (Playwright ARIA snapshots + keyboard and pointer interaction tests). Updates the Quiet story to render both default and quiet variants side-by-side so QuietTest and the ARIA snapshot can compare them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e003b59 to
80b74be
Compare
Description
Adds the Phase 6 test suite for the 2nd-gen
swc-infield-buttoncomponent. This PR contains only test and story files; the component implementation ships in the Phase 5 PR and must be merged intoswc-2105/infield-buttonbefore this branch is rebased.Files added:
stories/infield-button.stories.ts— Storybook stories with the Quiet story updated to render both default and quiet variants side-by-side for test comparisontest/infield-button.test.ts— 13 Storybook/Vitest play-function stories covering: defaults, property reflection (size, quiet, disabled, accessible-label), anatomy slots, sizes, quiet variant, states, click suppression, focus delegation, and dev-mode warningstest/infield-button.a11y.spec.ts— Playwright ARIA snapshot tests for all 6 stories plus keyboard (Tab does not focus the button) and pointer interaction tests (click fires when enabled, suppressed when disabled)Motivation and context
Phase 6 of the infield-button 2nd-gen migration. Establishes automated coverage for the full
InfieldButtonAPI surface so regressions can be caught during future refactors and dependency bumps.Depends on: Phase 5 PR must merge into
swc-2105/infield-buttonbefore this branch can be rebased and run independently.Related issue(s)
Screenshots (if appropriate)
N/A — test-only PR.
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Vitest play functions pass
2nd-gen/packages/swc/, runyarn vitest --project storybook infield-buttonOverviewTest,PropertyMutationTest,AccessibleLabelTest,AnatomyTest,SizesTest,QuietTest,StatesTest,DisabledBehaviorTest,ClickBehaviorTest,FocusDelegationTest,AccessibilityTest,IconOnlyMissingLabelWarningTest,IconOnlyWithLabelNoWarningTestPlaywright a11y spec passes
2nd-gen/packages/swc/, runyarn playwright test infield-button.a11y.spec.tsStorybook stories render correctly
yarn storybookfrom2nd-gen/packages/swc/No regressions in Action Button
yarn vitest --project storybook action-buttonButtonBaselogic)Device review
Accessibility testing checklist
Required: Complete each applicable item and document your testing steps.
Keyboard (infield buttons are pointer-only; Tab must not focus them)
swc-infield-button— the component is intentionally excluded from the tab order (tabindex="-1"on the inner button,delegatesFocus: falseon the shadow root). Keyboard activation is the responsibility of the parent field.Screen reader (button role and accessible name must be announced)
swc-infield-buttonelementbuttonand theaccessible-labelvalue are correctly forwarded viaaria-labelon the inner<button>elementdisabledattribute on the inner<button>provides the state without requiringaria-disabled