Skip to content

docs: add a component-testing skill - #8572

Open
tay1orjones wants to merge 3 commits into
mainfrom
tay1orjones-style-guide-candidates
Open

tay1orjones wants to merge 3 commits into
mainfrom
tay1orjones-style-guide-candidates

Conversation

@tay1orjones

@tay1orjones tay1orjones commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Related to #8527 and #8573.

Give agents a focused skill for writing and debugging Vitest browser tests. Follow the new write-skill conventions with explicit triggers and exclusions, keeping the guidance separate from component implementation and API design.

The guidance assumes the browser locator migration is complete and can land independently of the remaining migration work.

Changelog

New

  • A component-testing skill covering browser interactions, assertion timing, React updates, locators, and intentional low-level event tests.

Changed

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 the skill triggers for Vitest browser tests and excludes Node/SSR and standalone Playwright suites. Review the distinction between direct awaited browser interactions, RTL's act for manual updates, and synchronous assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a1e411c7-7f69-4ce9-9e3f-6f7ddd87b2bc
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0171203

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

@tay1orjones tay1orjones added the skip changeset This change does not need a changelog label Oct 19, 2026
@tay1orjones tay1orjones changed the title add component testing guidance to the style-guide skill Add component testing guidance to the style-guide skill Oct 19, 2026
@tay1orjones
tay1orjones marked this pull request as ready for review October 19, 2026 17:07
@tay1orjones
tay1orjones requested a review from a team as a code owner October 19, 2026 17:07
@tay1orjones
tay1orjones requested review from llastflowers and a balanced review from Copilot October 19, 2026 17:07
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8572 October 19, 2026 17:11 Inactive

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

Directly awaited interaction guidance needs an explicit browser-setup prerequisite to avoid React update warnings.

1 open issue
What changed in this PR

Adds component-testing conventions to the style-guide skill, supporting the browser-locator migration.

Changes:

  • Expands skill guidance to cover test authoring, modification, and debugging.
  • Documents interactions, assertion timing, React updates, locators, and intentional synthetic events.
File Description
.github/​skills/​style-guide/​SKILL.md Expands test-related usage and links the new topic.
.github/​skills/​style-guide/​docs/​component-testing.md Adds browser component-testing guidance and examples.

Review effort: Balanced

})
```

Await browser interactions directly, without wrapping them in `act`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair point. Not sure how big of a deal it is though.

@joshblack joshblack 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.

@tay1orjones what do you think of having this be in a testing (or test) skill that has the same structure as the style guide one? Specifically a short entry SKILL.md that links out to references, as needed.

I'll make a PR real quick for a /write-skill skill too to see what you think in terms of structure. My guess right now is that generally we will want these files to have a way to be quickly scanned but I'm not sure yet 🤔

@tay1orjones

Copy link
Copy Markdown
Contributor Author

@joshblack Yeah! Either way works for me, mainly just wanted to get this up as a start to discussion.

Do we want to avoid having another discover boundary for agents modifying behavior? It's probably less and less of a concern with current models. Selective loading within the style-guide skill should extend to this as well if we wanted to keep it here though.

@tay1orjones

Copy link
Copy Markdown
Contributor Author

The current eslint config already enables the recommended Vitest and RTL rules for unit tests, but would we want to lint importing act from RTL rather than React via no-restricted-imports?

@tay1orjones

Copy link
Copy Markdown
Contributor Author

Going to mark this a draft until #8573 is in and I can use it to regen the skill with the skill creator ... skill 😆

@tay1orjones
tay1orjones marked this pull request as draft October 20, 2026 14:29
tay1orjones and others added 2 commits October 22, 2026 09:44
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a1e411c7-7f69-4ce9-9e3f-6f7ddd87b2bc
@tay1orjones tay1orjones changed the title Add component testing guidance to the style-guide skill add a component-testing skill Oct 22, 2026
@tay1orjones

Copy link
Copy Markdown
Contributor Author

I used the new /write-skill to revise this guidance into a new /component-testing skill and removed it from the styleguide.

@tay1orjones
tay1orjones requested a review from joshblack October 22, 2026 14:48
@tay1orjones
tay1orjones marked this pull request as ready for review October 22, 2026 16:46
@tay1orjones tay1orjones changed the title add a component-testing skill docs: add a component-testing skill Oct 22, 2026
@tay1orjones
tay1orjones enabled auto-merge October 22, 2026 20:13
@primer
primer Bot disabled auto-merge October 23, 2026 15:49
@primer
primer Bot disabled auto-merge October 23, 2026 15:49
@primer
primer Bot enabled auto-merge October 23, 2026 15:49

This branch was successfully deployed

2 active deployments
storybook-preview-8572 — 0171203c Deployed Oct 22, 2026 by github-actions[bot]
github-pages — 0171203c Deployed Oct 22, 2026 by tay1orjones via deploy-preview #33860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants