frontend-test

Generates component tests for existing React and Vue components using Testing Library.

232|12|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/qf-studio/navigator --skill frontend-test-qf-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-test
Source: https://github.com/qf-studio/navigator/tree/main/skills/frontend-test
Command: npx skills add https://github.com/qf-studio/navigator --skill frontend-test-qf-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Existing frontend components often ship without tests, and writing tests by hand requires detecting the right framework, matching project conventions, and covering rendering, interactions, and accessibility. This Skill automates that entire workflow for components that already exist. ## Core Features & Use Cases - Framework Detection: Automatically detects React Testing Library, Vue Test Utils, Vitest, or Jest from package.json and setup files. - Convention-Aware Generation: Colocates test files with components, prefers getByRole queries over getByTestId, and only adds snapshot tests when the project already uses them. - Knowledge Graph Integration: Queries prior project patterns before generating and emits an execution summary afterward so future sessions reuse learned conventions. - Use Case: You have a UserProfile.tsx component written without tests. Ask for component tests and receive a passing UserProfile.test.tsx covering rendering, click interactions, and accessibility checks. ## Quick Start Ask the AI to write component tests for your existing component, for example by saying "test the UserProfile component".

Frequently Asked Questions about frontend-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write tests for an existing React component?

Provide the component file path or name, and the Skill reads the component, detects your test setup, and generates a colocated test file covering rendering, interactions, and accessibility. It then runs the tests to confirm they pass.

How to test Vue components with Vue Test Utils?

The Skill detects @vue/test-utils in package.json and generates tests matching that library's mounting and assertion patterns. It also checks for Vitest or Jest to use the correct runner imports.

React Testing Library vs snapshot testing, which should I use?

Assertion-based tests with getByRole queries are preferred for behavior because snapshots are brittle and easy to over-rely on. Snapshot tests are only generated when the project's existing test files already use them.

Does this work with both Vitest and Jest?

Yes, the Skill detects Vitest or Jest from package.json and generates the appropriate imports, such as vi.fn() from Vitest or Jest globals. It also checks setupTests.ts or vitest.setup.ts for global matchers.

When should I not use component test generation?

Do not use it when creating a new component from scratch, since component generation already includes tests, or when testing backend endpoints or visual regression. Those cases belong to backend-test and visual-regression workflows.