generate-tests

generate-tests is a skill for Cursor from leboncoin/spark-web. It costs 39 tokens per session (474 once invoked), scanned A, original, MIT.

A workflow for generating unit tests for Spark UI components using Vitest and React Testing Library. Unit tests check a small piece of software in isolation, while the testing tools render the component and simulate user actions.

In plain words
What is it for?
Use it to add or improve tests for rendering, properties, variants, user interactions, and accessibility in React components.
Why use it?
It provides a consistent way to cover missing behavior and reduce regressions when components or their properties change.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Install

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.

agentmods
npx agentmods add skills/leboncoin/spark-web/generate-tests
Any agent
npx skills add leboncoin/spark-web --skill generate-tests
Clone the repo
git clone --depth 1 https://github.com/leboncoin/spark-web

Made for: Cursor.

Wrote 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.

agentmods badge for generate-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/leboncoin/spark-web/generate-tests.svg)](https://agentmods.dev/skills/leboncoin/spark-web/generate-tests)
Your own site
<a href="https://agentmods.dev/skills/leboncoin/spark-web/generate-tests"><img src="https://agentmods.dev/badge/skills/leboncoin/spark-web/generate-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.00474
Opus 5 $0.00019 $0.00237
Sonnet 5 $0.00008 $0.00095
Haiku 4.5 $0.00004 $0.00047

Measured today against content hash 8b32439d8eab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

generate-tests 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 today.

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.

.cursor/skills/generate-tests/SKILL.md · 66 lines

What it actually says

Generate Tests

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

  1. Test File Location: Tests go in ComponentName.test.tsx in the component directory

  2. Testing Library Setup:

    • Use Vitest as the test runner
    • Use React Testing Library for rendering and queries
    • Use @testing-library/user-event for interactions
  3. 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
      })
    })
    
  4. 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
  5. Accessibility Testing:

    • Verify proper ARIA attributes
    • Test keyboard navigation
    • Verify focus management
    • Check semantic HTML
  6. Run Tests:

    • Use npm run test:ui for watch mode
    • Use npm run test:run for single run
    • Use npm run test:coverage for coverage report

Examples

Reference existing test files in packages/components/src/*/ComponentName.test.tsx for patterns.

Changes

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.

  1. today First seen · 66 lines · 39 tokens per session scan A 8b32439d8eab

Subscribe to this mod's changes

generate-tests is a skill published in the GitHub repository leboncoin/spark-web (93 stars, last pushed 2d ago), licensed MIT. It adds 39 tokens to every session and 474 once invoked, about $0.0002 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-09-05.

Related

Other skills, from other repositories

material-ui-review

Review the current diff for regressions, correctness bugs, tests, simplifications, and docs issues, scaling depth to a low/medium/high/xhigh/max effort level. Use ONLY when explicitly requested by name: the user runs /material-ui-review, writes $material-ui-review, or asks for "the Material UI review skill". Do NOT…

mui/material-ui · 137 tokens

chakra-ui-migrate

Migrate Chakra UI projects from v2 to v3, covering package changes, codemods, provider setup, color mode, prop renaming, compound components, theming, recipes, and Next.js updates. Use this skill whenever a user is upgrading Chakra UI versions, encountering breaking changes after an upgrade, converting old v2 patterns…

chakra-ui/chakra-ui · 137 tokens

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

chakra-ui-refactor

Review, convert, and improve UI code using Chakra UI v3. Use this skill whenever a user wants to review Chakra UI code for issues, convert plain HTML/CSS, Tailwind, CSS Modules, or styled-components to Chakra UI, clean up messy Chakra components, fix layout structure or token usage, or asks anything like "is this…

chakra-ui/chakra-ui · 139 tokens

material-ui-nextjs

Integrates Material UI with Next.js App and Pages routers using @mui/material-nextjs, Emotion cache providers, next/font, CSS layers with Tailwind/CSS Modules, Link component prop patterns, CSS theme variables SSR notes, and App Router useSearchParams + Suspense. Use when setting up or debugging MUI in a Next.js app.

mui/material-ui · 76 tokens

material-ui-styling

Chooses the right Material UI styling approach (sx, styled, theme overrides, global CSS) from official MUI guidance. Use when styling @mui/material components, customizing themes, overriding slots, or comparing sx vs styled.

mui/material-ui · 52 tokens