react-testing-standards

Guide React TypeScript tests with user-centric practices and query prioritization.

2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/masanao-ohba/claude-manifests --skill react-testing-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-testing-standards
Source: https://github.com/masanao-ohba/claude-manifests/tree/main/skills/typescript-react/testing-standards
Command: npx skills add https://github.com/masanao-ohba/claude-manifests --skill react-testing-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves flaky tests for React components by prescribing user-centric testing practices.

Core Features & Use Cases

  • Guidelines for testing philosophy, query priority, and best practices.
  • Patterns for component rendering, user interactions, async operations, and mocking.
  • Real-world use case: ensuring accessibility, predictable tests, and maintainable test suites across a React-TS project.

Quick Start

Install your project's testing setup and start applying the guidelines to write tests with React Testing Library and TypeScript. For example, render a component, use getByRole queries, and add asserts that reflect user behaviors.

Frequently Asked Questions about react-testing-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix flaky tests for React components?

React Testing Library query prioritization uses getByRole first to test accessible elements, followed by other accessible queries. This approach ensures tests validate actual user behavior and component accessibility rather than implementation details.

What's the best way to structure React and TypeScript testing patterns?

The best way to structure React and TypeScript testing patterns is by applying standard guidelines for component rendering, user interactions, async operations, and mocking strategies. This structured test organization ensures predictable, maintainable test suites.

How do I test accessibility in React integration tests?

To test accessibility in React integration tests, use user-centric query prioritization like getByRole to locate elements. This validates that components are accessible and interact exactly as users expect them to behave.

Can I use these React testing standards for both unit and integration tests?

Yes, you can apply these React testing standards to both unit and integration tests. The guidelines cover testing philosophy, component rendering, user interactions, and API calls to ensure compliance across your entire TypeScript project.

Why are my React unit tests failing due to implementation details?

React unit tests fail when they rely on implementation details instead of user-centric testing practices. By prioritizing accessible queries and validating user interactions, you prevent flaky tests caused by internal component refactoring.