Skip to content

test: migrate batch 3 component tests to browser locators - #8675

Open
tay1orjones wants to merge 3 commits into
mainfrom
tay1orjones-rtl-migration-batch-3
Open

tay1orjones wants to merge 3 commits into
mainfrom
tay1orjones-rtl-migration-batch-3

Conversation

@tay1orjones

Copy link
Copy Markdown
Contributor

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

  • Migrate Card, Checkbox, CheckboxGroup, CircleBadge, ConfirmationDialog, CounterLabel, DataTable, and ErrorDialog tests to Vitest browser locators and interactions.

Removed

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1c360400-9cc0-430e-9d11-acde80bacc11
@tay1orjones tay1orjones added the skip changeset This change does not need a changelog label Nov 3, 2026
@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ead6bda

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

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@tay1orjones tay1orjones added the integration-tests: skipped manually Changes in this PR do not require an integration test label Nov 3, 2026
@tay1orjones
tay1orjones marked this pull request as ready for review November 3, 2026 20:52
@tay1orjones
tay1orjones requested a review from a team as a code owner November 3, 2026 20:52
@tay1orjones
tay1orjones requested review from francinelucca and a balanced review from Copilot November 3, 2026 20:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Copilot AI commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Setup Playwright

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 copilot-code-review.yml file. Read the docs for details.

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

@francinelucca francinelucca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✨

This branch was successfully deployed

2 active deployments
storybook-preview-8675 — ead6bda2 Deployed Nov 3, 2026 by github-actions[bot]
github-pages — ead6bda2 Deployed Nov 3, 2026 by tay1orjones via deploy-preview #34044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants