frontend-unit-testing
Skill by gradio-app
Guides an AI assistant to write behaviour-driven unit tests for Gradio's Svelte frontend components. It uses Vitest browser mode, Playwright and the @self/tootils test utilities.
Install frontend-unit-testing
Built from the published package, never by AI.
git clone --depth 1 https://github.com/gradio-app/gradio /tmp/gradio && mkdir -p ~/.claude/skills && cp -r /tmp/gradio/.agents/skills/frontend-unit-testing ~/.claude/skills/frontend-unit-testingRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/gradio-app/gradio /tmp/gradio && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/gradio/.agents/skills/frontend-unit-testing ~/.gemini/antigravity-cli/skills/frontend-unit-testingAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install frontend-unit-testing in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill guides an AI assistant to write unit tests for Gradio's Svelte frontend components. It sets out principles such as testing behaviour rather than implementation, testing Gradio-specific features like get_data, set_data and events, and running tests in a real browser instead of jsdom. Tests use Vitest browser mode with a Playwright provider and the @self/tootils/render utilities.
The skill requires run_shared_prop_tests on every component test file and provides helpers for file uploads, drag and drop, downloads and fixtures. Visual-only props are flagged with test.todo placeholders for later visual regression testing. For a full component battery, the assistant must research, analyse and present a plan, then wait for approval before writing code. It is aimed at contributors to the Gradio frontend.
Written from the project's SKILL.md and checked against it.
What it can do
- Behaviour-driven component testsWrites unit tests that check observable behaviour instead of CSS classes or internal state.
- Gradio-specific testingCovers get_data, set_data, round-trips and dispatched events such as change, input and submit.
- Shared prop testsCalls run_shared_prop_tests for elem_id, elem_classes, visible, label, show_label and validation_error.
- Render utilitiesUses render, listen with retrospective option, fireEvent, cleanup and @testing-library queries.
- File utilitiesUses upload_file, drop_file, download_file, mock_client and the TEST_* file fixtures.
- Visual test placeholdersAdds test.todo entries for visual-only props that need screenshot comparison later.
- Full component test planResearches a component, lists testable surfaces and presents a plan before writing code.
What you need
- Node.js and pnpm
- Playwright with Chromium (chrome-headless-shell)
- Vitest browser mode configured in the Gradio repo
Try asking
- Write targeted unit tests for the lines prop of the Textbox component.
- Write a full test battery for the Accordion component and present a plan first.
- Add a test.todo for container_color on the Button component.
Good to know
- Production code should not be refactored for testability without explicit user approval.
- Mocking is discouraged and must be explained in a comment when used.
- Full component batteries require waiting for user approval before code is written.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/frontend-unit-testing/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md17 KB
Alternatives to frontend-unit-testing
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
frontend-unit-testing: common questions
Does this skill run tests in a visible browser?
The skill tells the assistant to prefix test commands with CI=1 so Vitest runs Playwright in headless mode.
Which test command should the assistant use?
The source says to always use pnpm test:run, because pnpm test starts in watch mode and never exits.
Does the skill use jsdom?
No. The source says tests run in a real browser through Vitest browser mode with a Playwright provider, not jsdom.
How do I install frontend-unit-testing?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is frontend-unit-testing free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is frontend-unit-testing safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to frontend-unit-testing?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
