pproenca avatar

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-code

Installs 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

PriorityCategoryImpactPrefix
1Query SelectionCRITICALquery-
2Async HandlingCRITICALasync-
3Common Anti-PatternsCRITICALanti-
4User InteractionHIGHuser-
5AssertionsHIGHassert-
6Component SetupMEDIUMsetup-
7Test StructureMEDIUMstruct-
8DebuggingLOW-MEDIUMdebug-
9Accessibility TestingLOWa11y-

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
1vercel-labs avatarvercel-react-best-practicesvercel-labs/agent-evalReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c408skills.sh installs
2ofershap avatartailwind-best-practicesofershap/tailwind-best-practicesStop your AI agent from generating Tailwind CSS v3 code. Rules for v4 syntax, CSS-first config, modern utility patterns, and common anti-patterns.405skills.sh installs
3secondsky avatarnuxt-coresecondsky/claude-skills| Nuxt 4 core framework fundamentals: project setup, configuration, routing, SEO, error handling, and directory structure. Use when: creating new Nuxt 4 project401skills.sh installs
4secondsky avatarnuxt-datasecondsky/claude-skills| Nuxt 4 data management: composables, data fetching with useFetch/useAsyncData, and state management with useState and Pinia. Use when: creating custom composa400skills.sh installs
5vercel-labs avatarjson-render-reactvercel-labs/json-renderReact renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating com391skills.sh installs
6gohypergiant avataraccelint-nextjs-best-practicesgohypergiant/agent-skillsNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions,386skills.sh installs