frontend-testing

frontend-testing is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 88 tokens per session (1,238 once invoked), scanned A, original, Apache-2.0.

A workflow for testing user-visible behaviour in interface components without opening the whole application in a browser. It uses component test tools to render screens, interact with controls, and check results.

In plain words
What is it for?
It helps test clicks, typing, displayed states, accessibility properties, network responses, and component-level regressions.
Why use it?
It catches broken component, form, hook, accessibility, and visual behaviour while avoiding tests tied to internal implementation details.

Skill for Claude CodeCodex

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

Good fit It helps test clicks, typing, displayed states, accessibility properties, network responses, and component-level regressions.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/frontend-testing"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,238 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.00088 $0.01238
Opus 5.5 $0.00035 $0.00495
Sonnet 5.5 $0.00018 $0.00248
Haiku 4.5 $0.00009 $0.00124

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

Security

Grade A, and why

frontend-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 16d 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.

runner/skills/frontend-testing/SKILL.md · 80 lines

How it starts

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

Test frontend code by behaviour, not implementation

Testing Library's guiding principle: the more your tests resemble the way your software is used, the more confidence they give you. A good component test renders with realistic props and providers, finds things by role and label, clicks and types, and asserts what the user sees or what the app sent. It survives refactors because it never reaches for internals. Full journeys belong to the e2e-browser-test skill; this covers everything below it, where most UI confidence is cheapest to buy.

Procedure

  1. Use the repo's runner and library. Vitest/Jest with Testing Library (React, Vue, Svelte, Angular flavours) or the framework's own harness, the repo's render helper that wires providers (router, query client, store, theme, i18n), and its network mock layer (MSW or a fetch mock). Call search_lore for conventions. Never add a second runner.
  2. Map each acceptance criterion to a user-visible outcome — "shows an error under the email field when it is invalid", "disables Submit while saving". Each gets a test named after that outcome; that test must fail if the criterion's behaviour breaks.
  3. Render realistically. The shared render helper, realistic props from a factory (the test-fixtures-and-factories skill), the network mocked at the fetch/HTTP boundary — not the component's own data hook, which would skip the code under test.
  4. Query like a user, in Testing Library's priority order: getByRole with name, getByLabelText, getByPlaceholderText, getByText, getByDisplayValue; then getByAltText/getByTitle; getByTestId last, with a comment. Use getBy* when the element must exist, queryBy* only to assert absence, findBy* for anything async.
  5. Interact with userEvent (const user = userEvent.setup(); await user.click, await user.type, await user.keyboard('{Tab}')) rather than fireEvent, so focus, keyboard and pointer sequences are real.
  6. Cover every state the ticket introduces: default, loading, empty, error, success, disabled, and each interaction path including keyboard-only and submit. For data components, make the mocked request fail (500, network error) and assert the error UI and the retry path, not only the happy render.
  7. Cover the async races the UI can hit when an AC touches them: a double-click on Submit sends one request; a slow response for an old search does not overwrite a newer one (resolve mocked responses out of order); unmounting mid-request produces no update or warning; optimistic updates roll back when the request fails.
  8. Assert visible outcomes. Text, roles, aria-invalid, disabled, focus position, navigation to the right path, the request sent with the right payload. Never internal state, CSS class names, or render counts (unless the ticket is about renders).
  9. Add accessibility checks for new UI: the repo's axe helper on each new state, keyboard reachability of every control, focus moved into and restored after dialogs (the frontend-a11y skill). Axe finds a subset of issues; it does not replace the role-based queries above.
  10. Keep snapshots small. A reviewed snapshot of a stable presentational fragment is fine; a page-sized snapshot nobody reads is noise. Visual regression belongs to the repo's visual tooling.
  11. Test hooks through a component or renderHook, asserting returned behaviour; async with findBy*/waitFor, fake timers only when explicitly enabled and advanced. Run the suite, then record evidence with the record-evidence skill (test_output).

Read the full file on GitHub · 80 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. 16d ago Changed · +16 lines 027fe43252bd
  2. 19d ago First seen · 64 lines · 88 tokens per session scan A a75c292cc088

Subscribe to this mod's changes

frontend-testing is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 88 tokens to every session and 1,238 once invoked, about $0.0004 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-28.