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.
npx skills add KunanonJ/ai-skills-hub --skill react-testinggit clone --depth 1 https://github.com/KunanonJ/ai-skills-hubWrote 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.
[](https://agentmods.dev/skills/kunanonj/ai-skills-hub/react-testing)<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/react-testing"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/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.
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/react-testing"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/react-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.03154 |
| Opus 5.5 | $0.00024 | $0.01262 |
| Sonnet 5.5 | $0.00012 | $0.00631 |
| Haiku 4.5 | $0.00006 | $0.00315 |
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 1mo 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.
This is a copy
100% identical to react-testing — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 424 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Testing
Comprehensive React testing patterns for behavior-focused component tests, custom hook tests, accessibility assertions, and network-level mocking.
When to Activate
- Writing tests for React components, custom hooks, or pages
- Adding test coverage to legacy untested components
- Migrating from Enzyme or class-component-era patterns to React Testing Library
- Setting up Vitest or Jest for a new React project
- Mocking HTTP requests in tests
- Asserting accessibility violations
- Deciding which tests belong in RTL vs Playwright Component Testing vs full E2E
Core Principle
Test what the user sees and does, not implementation details.
A test should:
- Render the component with the same providers it has in production
- Interact with it via accessible queries (role, label) and
userEvent - Assert visible output and observable side effects (callback fired, request sent)
A test should NOT:
- Inspect component state, props passed to children, or which hooks were called
- Mock React itself or framework hooks
- Assert on the number of renders or DOM structure beyond what affects users
Library Choice
| Runner | When | Note |
|---|---|---|
| Vitest | Vite, Remix, modern setups | Faster, native ESM, Jest-compatible API |
| Jest | Next.js, CRA, established repos | Default for many React projects |
| Playwright Component Testing | Real browser engine needed | Use when JSDOM lacks the required feature |
| Cypress Component Testing | Real browser, Cypress already in use | Alternative to Playwright CT |
Pick one. Do not run RTL + Vitest AND Playwright CT in the same repo unless you have a clear lane separation.
Query Priority
React Testing Library exposes queries in three tiers — use top-down:
- Accessible to everyone:
getByRole,getByLabelText,getByPlaceholderText,getByText,getByDisplayValue - Semantic:
getByAltText,getByTitle - Test IDs (escape hatch):
getByTestId
// Best
screen.getByRole("button", { name: /save/i });
// OK for inputs
screen.getByLabelText("Email");
// Last resort
screen.getByTestId("save-btn");
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.
- 1mo ago First seen · 424 lines · 59 tokens per session scan A 82ecdce94f7f
react-testing is a skill published in the GitHub repository KunanonJ/ai-skills-hub (5 stars, last pushed 1mo ago), licensed MIT. It adds 59 tokens to every session and 3,154 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to react-testing, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
e2e-check
Run E2E tests or interactive browser verification. Triggers on: 'run e2e', 'e2e test', 'browser test', 'check in browser', 'verify UI', 'interactive test'.
dev-testing
A testing guide that defines when to use unit, integration, API, and end-to-end tests. Unit tests check small pieces of code, while end-to-end tests check a full user flow.
dev-scenario-test
A specification for scenario testing, covering end-to-end tests, integration tests, and Artillery load tests. The input does not provide further details about its exact setup or outputs.
web-runtime-verify
Verify a built web frontend at runtime: serve the build, assert page identity, run the web battery (overflow 320 to 2560, keyboard, console, Lighthouse, axe), and decide a PASS/FAIL/BLOCKED gate. Fixes are routed, not applied. Do not use to plan (implementation-plan), write code (implement-approved-slice), for perf…
stress-test
Create an in-app stress test that runs from browser DevTools console via window.orbitdebug. Drives the real message pipeline (Tauri events, Zustand stores, Rust backend) with no mocks.
mosaic
Create in-app stress tests that drive the real application pipeline from browser DevTools. No mocks — real state, real APIs, real UI. Works for any web app with observable state.