Repository navigation
test: migrate batch 3 component tests to browser locators - #8675
tay1orjones wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1c360400-9cc0-430e-9d11-acde80bacc11
|
|
There was a problem hiding this comment.
🟡 Changes recommended
The revised assertions can miss regressions in the checkbox’s native indeterminate state and the dialog’s removal from the DOM.
2 open issues
What changed in this PR
This test-only PR continues Primer React’s migration to Vitest browser locators and interactions while retaining React Testing Library rendering and lifecycle utilities.
Changes:
- Migrates queries and DOM assertions across eight component test suites.
- Replaces simulated interactions with browser-backed clicks and keyboard input.
- Updates focus, loading-state, accessibility, and sorting checks without changing component implementations.
| File | Description |
|---|---|
packages/react/src/DataTable/__tests__/ErrorDialog.test.tsx |
Migrates dialog content and Retry/Dismiss interaction checks. |
packages/react/src/DataTable/__tests__/DataTable.test.tsx |
Migrates table semantics, accessible labels, and sorting tests. |
packages/react/src/CounterLabel/CounterLabel.test.tsx |
Migrates counter content and variant assertions. |
packages/react/src/ConfirmationDialog/ConfirmationDialog.test.tsx |
Migrates focus, loading, and dialog cleanup checks. |
packages/react/src/CircleBadge/CircleBadge.test.tsx |
Migrates title, icon, and attribute assertions. |
packages/react/src/CheckboxGroup/CheckboxGroup.test.tsx |
Migrates group state and change-handler tests. |
packages/react/src/Checkbox/Checkbox.test.tsx |
Migrates checkbox interactions, state, and ARIA assertions. |
packages/react/src/Card/Card.test.tsx |
Migrates content, landmark, styling, and attribute checks. |
Review effort: Balanced
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
Co-authored-by: tay1orjones <3360588+tay1orjones@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1c360400-9cc0-430e-9d11-acde80bacc11

Related to github/primer#6369.
Move browser-facing queries and interactions in component tests to Vitest browser locators while keeping RTL rendering and lifecycle utilities. The original behavioral assertions remain in place.
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
Check that Card landmarks and content, Checkbox controlled and indeterminate state, ConfirmationDialog focus and loading behavior, and DataTable sorting and accessible labels still behave as expected. Click Retry and Dismiss in ErrorDialog and confirm keyboard activation calls the corresponding handlers.
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com