Generate Tests
SkillDev toolsGenerate comprehensive unit tests for a Spark UI component using Vitest and React Testing Library. Use when the user wants to add tests, improve test coverage, or test a specific component.
Available today. Use it from your connected AI after setup.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the Generate Tests skill
What this skill tells your AI
The instructions your AI receives, as published by leboncoin/spark-web in .cursor/skills/generate-tests/SKILL.md and read by ahel’s review.
Create or update unit tests for Spark UI components following the project's testing standards.
When to Use
- User wants to add tests to a component
- User mentions "test", "testing", or "test coverage"
- Component is missing tests or has incomplete test coverage
Instructions
-
Test File Location: Tests go in
ComponentName.test.tsxin the component directory -
Testing Library Setup:
- Use Vitest as the test runner
- Use React Testing Library for rendering and queries
- Use
@testing-library/user-eventfor interactions
-
Test Structure:
import { describe, it, expect } from 'vitest' import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { ComponentName } from './ComponentName' describe('ComponentName', () => { it('should render', () => { render(<ComponentName {...defaultProps} />) expect(screen.getByRole('...')).toBeInTheDocument() }) it('should be accessible', () => { // Accessibility tests }) }) -
What to Test:
- Component renders correctly
- All props work as expected
- All variants (size, variant, etc.) render correctly
- User interactions (clicks, keyboard, etc.)
- Accessibility features (ARIA attributes, roles, etc.)
- Edge cases and error states
-
Accessibility Testing:
- Verify proper ARIA attributes
- Test keyboard navigation
- Verify focus management
- Check semantic HTML
-
Run Tests:
- Use
npm run test:uifor watch mode - Use
npm run test:runfor single run - Use
npm run test:coveragefor coverage report
- Use
Examples
Reference existing test files in packages/components/src/*/ComponentName.test.tsx for patterns.
Signals
- GitHub stars
- 93
- Forks
- 27
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
generate-tests-leboncoin- Source
- github.com/leboncoin/spark-web