What problem does it solve?
This Skill helps you avoid brittle, implementation-focused React Testing Library tests by guiding you toward maintainable, user-centric assertions and interactions that match how people actually use the UI.
Core Features & Use Cases
- Query selection that reflects accessibility: Prefer role- and label-based queries to verify the accessibility tree and reduce order/structure brittleness.
- Reliable async and interaction patterns: Use findBy, await userEvent, and keep waitFor focused on the right kind of waiting to prevent flaky or false-positive tests.
- Common anti-pattern prevention: Avoid unnecessary act(), manual cleanup, container/querySelector querying, empty waitFor callbacks, and implementation details that break during refactors.
- Structured, reviewable tests: Apply Arrange-Act-Assert, test one behavior per test, and use descriptive naming for faster failure diagnosis.
Quick Start
Use the react-testing-library skill to review or write a React component test by replacing getByTestId, fixing async handling with findBy/await, and rewriting assertions to use user-visible queries and jest-dom matchers.