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 ApexIQ/skillsmith --skill frontend_testing_best_practicesgit clone --depth 1 https://github.com/ApexIQ/skillsmithWrote 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/apexiq/skillsmith/frontend_testing_best_practices)<a href="https://agentmods.dev/skills/apexiq/skillsmith/frontend_testing_best_practices"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/frontend_testing_best_practices.svg" alt="Measured on agentmods" 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.00027 | $0.00595 |
| Opus 5 | $0.00014 | $0.00298 |
| Sonnet 5 | $0.00005 | $0.00119 |
| Haiku 4.5 | $0.00003 | $0.00060 |
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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.
⚛️ Frontend Testing Best Practices
Philosophy: Test how the user uses your app, not how the code is written.
1. The Stack
- Runner: Vitest, Jest, or framework-specific runner.
- DOM Simulation: Testing Library (React/Vue/Angular).
- User Simulation:
@testing-library/user-event.
2. Core Principles
- Prioritize Behavior:
- ✅
screen.getByRole('button', { version: 0.1.0 name: /submit/i })(What user sees) - ❌
container.querySelector('.btn-primary')(Implementation detail)
- ✅
- Accessibility First: Use
getByRolequeries. Forces accessible HTML. - Mock External Dependencies: Don't hit real APIs.
- Use MSW (Mock Service Worker) for network mocking.
- Mock complex libraries if just testing component logic.
3. Structure of a Test
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import MyComponent from './MyComponent';
test('submitting the form shows success message', async () => {
const user = userEvent.setup();
render(<MyComponent />);
// 1. Arrange (Find elements)
const input = screen.getByLabelText(/email/i);
const button = screen.getByRole('button', { version: 0.1.0
name: /submit/i });
// 2. Act (User interaction)
await user.type(input, '[email protected]');
await user.click(button);
// 3. Assert (Expected outcome)
expect(await screen.findByText(/success/i)).toBeInTheDocument();
});
4. Testing Advanced UI Patterns
- Optimistic UI: Verify UI updates before API resolves.
- Animations: Mock animation libraries or check final states.
- Keyboard Shortcuts: Test with
user.keyboard('{Meta>}{k}{/Meta}').
Examples
- Form validation: Type invalid input -> Submit -> Verify error message shown.
- Modal: Click button -> Verify modal opens -> Click outside -> Verify closes.
Guidelines
- One test = one user behavior.
- Avoid testing implementation details (state, props).
- Use
findByfor async elements,getByfor sync.
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.
- 8d ago First seen · 72 lines · 27 tokens per session scan A c04d61b1be47
frontend-testing is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 27 tokens to every session and 595 once invoked, about $0.0001 per session on Opus 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.
Other skills, from other repositories
storybook-testing
Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking, accessibility addon testing, and autodocs generation. Use when writing component stories, setting up visual regression testing…
react-component-testing
Applies the three-tier test taxonomy for React applications: unit tests for hooks and pure logic, component tests for behavior and interactions, and end-to-end tests for user flows. Uses Vitest, React Testing Library, and Playwright while focusing on observable behavior over implementation details.
dev-nextjs
Next.js development (App Router, Server Components, caching, streaming). Trigger when the user works with Next.js, modifies app/, pages/, next.config, or talks about RSC, Server Actions, Route Handlers, middleware.
dev-react-perf
React/Next.js performance optimization. Trigger when the user wants to optimize rendering, reduce re-renders, or improve Core Web Vitals.
dev-shadcn
Integration and customization of shadcn/ui (copy-paste React components, Radix + Tailwind). Trigger when the user wants to install shadcn, add components, customize the theme, or when shadcn/ui usage is detected in the project.
state-management
State management patterns and implementation. Trigger when the user wants to manage global state, use Redux, Zustand, or other solutions.