react-component-testing

react-component-testing is a skill for Claude Code, Codex from soulcodex/agentic. It costs 59 tokens per session (654 once invoked), scanned A, original, MIT.

A testing approach for React applications that separates tests for small logic, individual components, and complete user journeys across pages.

In plain words
What is it for?
Use it to test hooks and pure functions with Vitest, component behaviour with React Testing Library, and multi-page flows with Playwright.
Why use it?
It helps match each kind of code with an appropriate test and checks what users can observe instead of internal implementation details.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions OpenCode.

Good fit Use it to test hooks and pure functions with Vitest, component behaviour with React Testing Library, and multi-page flows with Playwright.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/soulcodex/agentic/react-component-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 soulcodex/agentic --skill react-component-testing
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

Made for: Claude Code, Codex.

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-component-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/soulcodex/agentic/react-component-testing/github.svg)](https://agentmods.dev/skills/soulcodex/agentic/react-component-testing)
Your own site
<a href="https://agentmods.dev/skills/soulcodex/agentic/react-component-testing"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/react-component-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-component-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/soulcodex/agentic/react-component-testing"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/react-component-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 654 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00059 $0.00654
Opus 5.5 $0.00024 $0.00262
Sonnet 5.5 $0.00012 $0.00131
Haiku 4.5 $0.00006 $0.00065

Measured 1mo ago against content hash c88edd5c454a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

react-component-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.

skills/ui/react-component-testing/SKILL.md · 84 lines

How it starts

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

React Component Testing Skill

Step 1 — Classify What Needs to Be Tested

Assign each file to a test tier before writing tests:

  • Hook / reducer / pure function -> unit test.
  • Component behavior / interaction -> component test.
  • Multi-page user flow -> end-to-end test.

Step 2 — Write Unit Tests

  • Test hooks with renderHook and explicit inputs.
  • Test reducers and utilities as pure functions.
  • Mock network boundaries; do not mount full UI.
import { describe, expect, it } from 'vitest'
import { authReducer } from './auth.reducer'

it('sets user on login success', () => {
  const state = authReducer({ user: null }, { type: 'login/success', payload: { id: '1' } })
  expect(state.user?.id).toBe('1')
})

Step 3 — Write Component Tests

  • Use React Testing Library queries by role/label/text.
  • Use userEvent for interactions, not low-level DOM event simulation unless necessary.
  • Wrap with providers used in production (router, query client, store) via a shared test render utility.
  • Assert user-visible output and callback side effects.
  • In TypeScript projects, keep TS/JS imports ESM-only and use aliases for cross-directory imports.
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { SaveButton } from './SaveButton'

it('calls onSave when clicked', async () => {
  const onSave = vi.fn()
  render(<SaveButton onSave={onSave} />)
  await userEvent.click(screen.getByRole('button', { name: 'Save' }))
  expect(onSave).toHaveBeenCalledTimes(1)
})

Step 4 — Write End-to-End Tests

  • Use Playwright for full browser flows across routes.
  • Cover one happy path and key failure path for each critical user journey.
  • Keep E2E focused on integration risks, not exhaustive branch coverage.

Step 5 — Verify

  • Each custom hook has unit tests for success and edge behavior
  • Interactive components test primary user interactions
  • No tests assert private state or implementation-only details
  • Critical journeys have Playwright coverage (happy path + failure path)
  • pnpm test passes with zero failures

Read the full file on GitHub · 84 lines

Files

What ships with it

1 file 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. 1mo ago First seen · 84 lines · 59 tokens per session scan A c88edd5c454a

Subscribe to this mod's changes

react-component-testing is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 28d ago), licensed MIT. It adds 59 tokens to every session and 654 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

test-app

Verify a running Mendix app in a browser: mxcli playwright check for a one-call text verdict per page (renders? error banner? console errors? rows?), playwright-cli scripts for interaction, OQL for data. Use when asked to check a page, see whether it renders, verify in the browser, test the app end to end, or confirm…

mendixlabs/mxcli · 86 tokens

hatch3r-browser-verify

Opt-in browser verification skill — spec-run-first Playwright verification (assertions execute in the runner, agent reads only failures), axe-core a11y audits, toHaveScreenshot() regression diffs, E2E test scaffolds, and snapshot-mode exploratory driving. Default ON for UI-affecting agent invocations; disable globally…

hatch3r/hatch3r · 83 tokens

agent-browser

Browser automation CLI for AI agents. Use when the user needs to inspect, test, or automate browser behavior: navigating pages, filling forms, clicking buttons, taking screenshots, extracting page data, testing web apps, dogfooding Open Design previews, QA, bug hunts, or reviewing app quality. Prefer local Open Design…

wolfenazz/YzPzCode · 81 tokens

next-cache-components-optimizer

Optimize the meaningful UI available immediately from a Next.js route on an initial load (hard navigation) or named client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route and entry point at a time; the shipped test then guards…

vercel/next.js · 123 tokens

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work.

browser-use/browser-use · 26 tokens

next-partial-prefetching-optimizer

Optimize what selected Next.js client navigations include before the click under Partial Prefetching. Use after Cache Components and Partial Prefetching are adopted when the user wants selected URL-specific UI to be instant, wants reusable content to wait for navigation, or needs to choose between default, viewport…

vercel/next.js · 82 tokens