component-testing

component-testing is a skill for Claude Code from saajunaid/caddis-plugin. It costs 50 tokens per session (2,556 once invoked), scanned A, original, MIT.

A toolkit for testing React components, hooks, and their user-facing states. It supports Vitest, Testing Library, simulated API responses with MSW, and related test setup.

In plain words
What is it for?
Use it to write component tests, hook tests, snapshots, user interaction checks, and mocked API scenarios in React projects.
Why use it?
It helps catch problems in individual interface pieces without testing the whole application. It also provides ways to test loading, error, interaction, and API-dependent behavior.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter.

Good fit Use it to write component tests, hook tests, snapshots, user interaction checks, and mocked API scenarios in React projects.

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

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/component-testing"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/component-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,556 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.00050 $0.02556
Opus 5.5 $0.00020 $0.01022
Sonnet 5.5 $0.00010 $0.00511
Haiku 4.5 $0.00005 $0.00256

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

Security

Grade A, and why

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 2mo 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.

.github/skills/testing/component-testing/SKILL.md · 311 lines

How it starts

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

Component Testing Skill

React component and hook testing with Vitest + Testing Library. For E2E tests, use the playwright skill. For methodology, use tdd-workflow. This skill covers unit and integration testing of components.

1. Vitest Setup

vite.config.ts

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  test: {
    environment: 'jsdom',      // or 'happy-dom' (faster, less spec-compliant)
    globals: true,             // No need to import describe/it/expect
    setupFiles: ['./src/test/setup.ts'],
    coverage: {
      provider: 'v8',
      reporter: ['text', 'html', 'lcov'],
      include: ['src/**/*.{ts,tsx}'],
      exclude: ['src/**/*.stories.*', 'src/test/**'],
      thresholds: { lines: 80, functions: 80, branches: 70 },
    },
  },
})

src/test/setup.ts

import '@testing-library/jest-dom'    // Adds toBeInTheDocument(), toHaveValue(), etc.
import { cleanup } from '@testing-library/react'
import { afterEach, beforeAll, afterAll } from 'vitest'
import { server } from './msw/server'  // MSW server (if using)

beforeAll(() => server.listen({ onUnhandledRequest: 'error' }))
afterEach(() => { cleanup(); server.resetHandlers() })
afterAll(() => server.close())

2. Testing Library — Query Priority

Use queries from most to least accessible:

Priority Query Why
1 getByRole Tests semantic HTML + ARIA — closest to real user experience
2 getByLabelText Tests forms with labels — accessibility signal
3 getByPlaceholderText Acceptable for inputs without labels
4 getByText Tests text content
5 getByDisplayValue Tests current input/textarea/select value
6 getByAltText Tests image alt text
7 getByTitle Low priority — title attributes are often hidden
Avoid getByTestId Last resort only — no accessibility signal
// ✅ GOOD: Role + accessible name
const button = screen.getByRole('button', { name: /save changes/i })

// ✅ GOOD: Label association
const emailInput = screen.getByLabelText(/email/i)

// ❌ AVOID unless no alternative
const element = screen.getByTestId('submit-btn')

Read the full file on GitHub · 311 lines

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. 2mo ago Changed · -29 tokens per session f6cd50c96fa4
  2. 2mo ago First seen · 311 lines · 79 tokens per session scan A f9367ac7561a

Subscribe to this mod's changes

component-testing is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 3d ago), licensed MIT. It adds 50 tokens to every session and 2,556 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-09-03.

Related

component-testing compared with skills from other repositories

component-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
component-testingsaajunaid/caddis-pluginSkill03d agoMITA50Claude Code
agent-testerruvnet/rufloSkill83ktodayMITA15Claude Code
test-generatoralirezarezvani/claude-code-tresorSkill79020d agoMITA55Claude Code
goga-cookbookqarium/gogaSkill468d agoBSD-3-ClauseA19Claude Code, Codex
goga-review-planqarium/gogaSkill468d agoBSD-3-ClauseA11Claude Code, Codex
goga-define-challengeqarium/gogaSkill468d agoBSD-3-ClauseA6Claude Code, Codex
goga-task-by-specifyingqarium/gogaSkill468d agoBSD-3-ClauseA14Claude Code, Codex