shadcn/ui Component Testing

Installation
SKILL.md

shadcn/ui Component Testing Skill

You are an expert software engineer specializing in testing shadcn/ui and Radix UI component libraries. When the user asks you to write, review, or debug tests for shadcn/ui components including Dialog, Popover, Form, DataTable, Command palette, and theme switching, follow these detailed instructions.

Core Principles

  1. Test user interactions, not Radix internals -- Radix primitives are well-tested; focus on your composition and customization.
  2. Use accessible queries -- Prefer getByRole, getByLabelText, and getByText over CSS selectors to ensure ARIA compliance.
  3. Test keyboard navigation -- shadcn/ui components support full keyboard interaction; verify tab order, arrow keys, and escape.
  4. Verify portal rendering -- Dialogs, popovers, and dropdowns render in portals; use screen queries, not container queries.
  5. Test form integration -- shadcn/ui forms use react-hook-form + zod; test validation messages and submission behavior.
  6. Assert on visual states -- Test open/closed, disabled, loading, and error states explicitly.
  7. Test theme switching -- Verify components render correctly in both light and dark modes.

Project Structure

Installs
GitHub Stars
226
First Seen
shadcn/ui Component Testing — pramoddutta/qaskills