react-testing

react-testing is a skill for Claude Code, Codex from LeahyCC/claude-skills. It costs 185 tokens per session (1,625 once invoked), scanned A, original, MIT.

A guide for writing and reviewing React component tests with Vitest, Testing Library, user-event, jest-dom, and MSW. It focuses on checking what users can see and do rather than relying on internal implementation details.

In plain words
What is it for?
Use it to create or fix tests for rendering, user interactions, delayed results, errors, network requests, navigation, and React Server Components.
Why use it?
It helps avoid fragile tests, incorrect element queries, missed asynchronous updates, timer hangs, and misleading network mocks. It also addresses common setup issues such as cleanup, accessibility, and jsdom limitations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or fix tests for rendering, user interactions, delayed results, errors, network requests, navigation, and React Server Components.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leahycc/claude-skills/react-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeahyCC/claude-skills --skill react-testing
Clone the repo
git clone --depth 1 https://github.com/LeahyCC/claude-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin react-testing — /plugin install react-testing after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/leahycc/claude-skills/react-testing/github.svg)](https://agentmods.dev/skills/leahycc/claude-skills/react-testing)
Your own site
<a href="https://agentmods.dev/skills/leahycc/claude-skills/react-testing"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/react-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for react-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/leahycc/claude-skills/react-testing"><img src="https://agentmods.dev/badge/skills/leahycc/claude-skills/react-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 185 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00185 $0.01625
Opus 5.5 $0.00074 $0.00650
Sonnet 5.5 $0.00037 $0.00325
Haiku 4.5 $0.00018 $0.00162

Measured 28d ago against content hash 454868c1fb4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

react-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/react-testing/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React testing

Tests that fail when the feature breaks and pass when it works, whatever the internals look like. Find elements the way a user does, act the way a user does, and wait for what a user would see.

Query by role and name first. If you cannot, the component probably has an accessibility bug.

Mock the edges (network, clock, framework), never your own code.

Versions, source checks, and dates: SOURCES.md.

Procedure

  1. Read the component, its existing tests, vitest.config.*, and the setup file. Check the package versions; this skill assumes the stack in SOURCES.md.
  2. Pick what the user does and what they should see as a result. That pair is the test.
  3. Route by what the test needs, and load only that resource:
writing or fixing a test
      |
      +-- finding an element, asserting present or absent ...... queries.md
      |
      +-- clicking, typing, tabbing, uploading .................. user-events.md
      |
      +-- something appears later, a timer, an act warning ...... async.md
      |
      +-- config, cleanup, providers, hooks, jsdom crashes ...... setup.md
      |
      +-- fetch, vi.mock, next/navigation ...................... network-and-mocks.md
      |
      +-- async page, Server Function, useActionState ........... server-components.md
  1. Run the test. Then break the feature on purpose (comment out the handler, return the wrong value) and confirm the test fails. A test that still passes proves nothing.

Where to read

Topic Resource
Query priority, getBy/queryBy/findBy, role and name, within, absence, screen, text matching, test IDs queries.md
userEvent.setup(), forms, keyboard and focus, uploads, clipboard, pointer-events: none, fireEvent cases user-events.md
findBy, waitFor rules, waitForElementToBeRemoved, act warnings, fake timers in Vitest async.md
Packages, vitest.config.ts, cleanup without globals, jsdom vs browser mode, jsdom gaps, custom render, renderHook, StrictMode setup.md
What to mock, MSW 3 setup and error paths, vi.mock and vi.hoisted, next/navigation, spies network-and-mocks.md
Async Server Components, Server Functions, useActionState forms, what goes to E2E server-components.md

Read the full file on GitHub · 90 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 28d ago First seen · 90 lines · 185 tokens per session scan A 454868c1fb4a

Subscribe to this mod's changes

react-testing is a skill published in the GitHub repository LeahyCC/claude-skills (4 stars, last pushed yesterday), licensed MIT. It adds 185 tokens to every session and 1,625 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-02.

Related

react-testing compared with skills from other repositories

react-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
react-testingLeahyCC/claude-skillsSkill4yesterdayMITA185Claude Code, Codex
Accessibility Audit HelperNotysoty/openagentskillsSkill93mo agoMITA23Claude Code, Codex
accessibilityericrisco/rsc-harnessSkill6915d agoMITA86Claude Code, Codex
kb-framework-accessibilityCommunity-Access/accessibility-agentsSkill460todayMITA37Claude Code, Codex
Axe-core Accessibility TestingPramodDutta/qaskillsSkill25328d agoMITA33Claude Code, Codex
Accessibility AuditorPramodDutta/qaskillsSkill25328d agoMITA32Claude Code, Codex
Accessibility A11y EnhancedPramodDutta/qaskillsSkill25328d agoMITA34Claude Code, Codex