frontend testing

AI Community

Skill notes

When to Apply This Skill

Apply this skill when the user: Asks to write tests for a component, hook, or utility Asks to review existing tests for completeness Mentions Vitest, React Testing Library, RTL, or spec files Requests test coverage improvement

Key Commands

Run these commands from web/. From the repository root, prefix them with pnpm -C web.

File Naming

Test files: ComponentName.spec.tsx inside a same-level __tests__/ directory Placement rule: Component, hook, and utility tests must live in a sibling __tests__/ folder at the same level as the source under test. For example, foo/index.tsx maps to foo/__tests__/index.spec.tsx, and foo/bar.ts maps to foo/__tests__/bar.spec.ts. Integration tests: web/__tests__/ directory

⚠️ Incremental Approach Required

NEVER generate all test files at once. For complex components or multi-file directories: Analyze & Plan: List all files, order by complexity (simple → complex) Process ONE at a time: Write test → Run test → Fix if needed → Next Verify before proceeding: Do NOT continue to next file until current passes

Complexity-Based Order

Process in this order for multi-file testing: 🟢 Utility functions (simplest) 🟢 Custom hooks 🟡 Simple components (presentational) 🟡 Medium components (state, effects)

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
AI
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@langgenius · no license declared
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
Python
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview frontend-testing.preview
# Reference Examples in Codebase

- `web/utils/classnames.spec.ts` - Utility function tests
- `web/app/components/base/radio/__tests__/index.spec.tsx` - Component tests
- `web/__mocks__/provider-context.ts` - Mock factory example

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.