React component testing
Skill alexngai/skill-tree/docs/demo/skills/react-component-testing
Test React components with Testing Library — render, query by role, and assert on user-visible behavior.From its SKILL.md
npx -y skills add alexngai/skill-tree --skill react-component-testingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
0.7 KB, 111 tokens by cl100k_base, as published. Nobody here has run it
React Component Testing
Test what the user sees, not implementation details.
render(<Component />)from@testing-library/react.- Query by accessible role:
screen.getByRole('button', { name: /save/i }). - Drive interactions with
userEvent, then assert on the resulting DOM. - Avoid
container.querySelectorand snapshot-everything tests — they break on refactors.
Prefer findBy* for async UI and getBy* for content that is already present.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.