
React Testing Library
This one gives Claude 43 rules across 9 priority-ranked categories for writing React Testing Library tests the right way. It's built around the testing library philosophy of querying by role and label text instead of test IDs, using userEvent over fireEvent, and avoiding implementation details. The rules cover the critical stuff like query selection and async handling first, then work down to accessibility testing. Useful when you're writing new component tests, reviewing PRs for anti-patterns, or trying to remember whether to use findBy or waitFor with getBy. The categorization by impact level is smart because it tells you what actually matters versus what's just polish.
- skills.sh installs
- 418
- GitHub stars
- 222
- last updated
- Aug 21, 2026
Install
$ npx -y skills add pproenca/dot-skills --skill react-testing-library --agent claude-codeInstalls into .claude/skills of the current project.
Files
React Testing Library Best Practices
Comprehensive testing guide for React components using Testing Library, designed for AI agents and LLMs. Contains 43 rules across 9 categories, prioritized by impact to guide test writing and code review.
When to Apply
Reference these guidelines when:
- Writing new component tests with React Testing Library
- Selecting queries (getByRole, getByLabelText, etc.)
- Handling async operations in tests (findBy, waitFor)
- Simulating user interactions (userEvent)
- Reviewing tests for anti-patterns and implementation detail testing
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Query Selection | CRITICAL | query- |
| 2 | Async Handling | CRITICAL | async- |
| 3 | Common Anti-Patterns | CRITICAL | anti- |
| 4 | User Interaction | HIGH | user- |
| 5 | Assertions | HIGH | assert- |
| 6 | Component Setup | MEDIUM | setup- |
| 7 | Test Structure | MEDIUM | struct- |
| 8 | Debugging | LOW-MEDIUM | debug- |
| 9 | Accessibility Testing | LOW | a11y- |
Quick Reference
1. Query Selection (CRITICAL)
Sponsors
Details
- Repository
- github.com/pproenca/dot-skills
- Categories
- Frontend Development, Testing & QA, Documentation, Code Review & Quality
- First seen
- Jun 3, 2026
More from pproenca/dot-skills
All 100- Jscodeshift416
- Expo React Native Coder415
- Tdd415
- Humanize409
- React Optimise403
- Knip Deadcode390
- Rails Hotwire380
- Ts Google378
- Nginx C Module Design369
- Vite367
- Nginx C Modules365
- Ios Animations355
- Dockerfile Optimise351
- Uniwind348
- 37signals Rails340
- Ast Grep340
- Audio Voice Recovery340
- Orval338
- Mui Base335
- Codemod334
- Vhs331
- Skill Authoring330
- Unix Cli326
- Python323