frontend-testing
Skill0 starsChanged 5 months agoMITView on GitHub
Scaffolds and strengthens flow-frontend tests with Vitest + React Testing Library, asserting rendered DOM through the real UI path, and hands E2E off to Playwright. Use when the user says "add a test", "write tests for this component", "strengthen these tests", "test this hook", or "/frontend-testing".
18 other projects use a version of this.
Adopted by
Most recently taken up by
- LongJohnSilver1504/claude-skillstheir own version, first seen Nov 8, 2026
- lien0219/openxflowtheir own version, first seen Nov 8, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- YosemiteCrew/Yosemite-Crewtheir own version, first seen Nov 1, 2026
- langgenius/difytheir own version, first seen Oct 29, 2026
- aboio-labs/aboio-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use backend-code-review, frontend-query-mutation and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
jpoindexterSkillbackend-code-review
Review backend code for quality, security, maintainability, and best practices based on established checklist rules. Use when the user requests a review, analysis, or improvement of backend files (e.g., `.py`) under the `api/` directory. Do NOT use for frontend files (e.g., `.tsx`, `.ts`, `.js`). Supports pending-change review, code snippets review, and file-focused review.
Also in 5 projects that use this
lien0219Skillfrontend-query-mutation
Guide for implementing Langflow frontend query and mutation patterns with Axios and TanStack React Query v5. Trigger when creating or updating API hooks in controllers/API/queries, consuming UseRequestProcessor in components, deciding whether to use useQuery or useMutation, handling conditional queries, cache invalidation, mutation error handling, or migrating legacy API calls to the query hook pattern.
Also in 3 projects that use this
Charlie85270Skillcomponent-refactoring
Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.
Also in 4 projects that use this
chendongqiSkillfrontend-code-review
Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.
Also in 7 projects that use this
etewiahSkille2e-testing
Playwright E2E testing and Lighthouse performance auditing. Use when setting up E2E tests, running Playwright tests, performing Lighthouse audits, or debugging E2E test failures.
Also in 3 projects that use this
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- langgenius/dify★ 161ksame name
- langflow-ai/langflow★ 156ksame name
- YFGaia/dify-plus★ 2.3ksame name
- YosemiteCrew/Yosemite-Crew★ 2ksame name
- Ohh-889/skyroc-admin★ 795same name
- theexperiencecompany/gaia★ 325same name
- mcowger/plexus★ 239same name
- nightscout/nocturne★ 163same name
- nilecui/SkillsBase★ 27same name
- lien0219/openxflow★ 8same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-server-actionSkill
- brainstormingSkill
- buf-bumpSkill
- e2e-test-fixtureSkill
- new-componentSkill
- new-pageSkill
- proto-migrationSkill
- receiving-code-reviewSkill
- systematic-debugSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write or strengthen tests that assert real behavior, not helper output.
- Very specific: line 24
Render and assert the DOM: Use render + screen from @testing-library/react and userEvent for interaction.
- Very specific: line 38
Cover combinatorial cases with a table: When behavior varies across inputs (variant × disabled, role × feature-flag, empty/one/many), drive …
- Distinctive: line 43
Add a canary for silent failures: If a test could pass while the feature is mis-wired (e.g.
- Very specific: line 68
Keep cleanup() in afterEach.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/frontend-testing
Write or strengthen tests that assert real behavior, not helper output. Mock-heavy tests that
bypass the UI are near-worthless: the closer a mock sits to the component, the less the test
proves. Conventions live in the testing rule (installed at .claude/rules/testing.md) —
follow them; this skill is the procedure.
Runs in flow-frontend. Tests are co-located *.test.tsx/*.test.ts files run by Vitest
in jsdom. The React plugin varies: the apps use @vitejs/plugin-react-swc, several packages
use plain @vitejs/plugin-react — read the target package's vitest.config.ts. One test file
per source file. Run a package's suite with pnpm test.
Steps
- Identify the unit and its real entry point. For a component, that is rendering it and
driving it through user-visible interactions — not calling its internal handlers directly.
For a hook, render it inside a host component or
renderHook. - Render and assert the DOM. Use
render+screenfrom@testing-library/reactanduserEventfor interaction. Every test makes at least one positive assertion on rendered output that a user could observe:- Query by role/label/text (
getByRole,findByText), not test-id, unless the element has no accessible handle. - Assert visible state changed (
toBeInTheDocument,toBeDisabled,toHaveTextContent), not that an internal function was called. awaitasync UI withfindBy*/waitFor;cleanup()inafterEach.
- Query by role/label/text (
- Exercise the real UI path. Click the actual button, type into the actual field, submit
the actual form. A test that calls
onSubmit(values)directly proves nothing about whether the form wires up. Mock only at true boundaries — the RPC client / server action — never the component's own logic or converters. - Cover combinatorial cases with a table. When behavior varies across inputs (variant ×
disabled, role × feature-flag, empty/one/many), drive a
it.each/describe.eachtable so the matrix is explicit and readable. Include the edge rows: empty list, single item, error state, loading state. - Add a canary for silent failures. If a test could pass while the feature is mis-wired (e.g. a parity test where both sides read the same stub), add a positive assertion that fails loudly when the wiring breaks. A green suite must mean the feature works.
- Hand E2E to Playwright. Vitest covers component and unit behavior. Cross-page flows,
auth, real navigation, and business-intent journeys belong in Playwright against the running
stack — do not fake them in jsdom. To author those, use the Playwright planner/generator
agents; to make them runnable, use the
e2e-test-fixtureskill. - Run and report.
pnpm test(or scope to the package). Report what is covered, which cases the table exercises, and any behavior you deliberately pushed to E2E.
Anti-patterns to reject
- Asserting a mock was called instead of asserting the rendered result.
- Testing a converter's output by importing the converter — test it through the component that uses it, or test the converter directly as a pure function, but never mock it inside a component test.
- A snapshot as the only assertion. Snapshots catch nothing intentional; assert specifics.
Gotchas
- The apps' vitest configs use
@vitejs/plugin-react-swc, not@vitejs/plugin-react. Copying a plugin import from a package config into an app config (or vice versa) silently changes the transform. - Keep
cleanup()inafterEach. Several packages (primary-nav,flow-auth,connect-server-actions, others) have no global cleanup in theirvitest.setup.ts, so omitting it there leaks DOM between tests. Where a global setup does call it (the apps,ui-toolkit), the extra call is idempotent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

