npx skills add smithery/spences10 --skill component-testing-patterns
spences10/devhub-crm · Archived
component-testing-patterns
Vitest browser mode component testing. Use for testing Svelte 5 components with real browsers, locators, accessibility patterns, and reactive state.
Installation
npx skills add spences10/devhub-crm --skill component-testing-patterns
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Better-auth integration for authentication. Use when implementing login, registration, protecte…
4 installsDaisyUI v5 design system. Use for backgrounds, borders, text sizes, opacity, semantic colors, a…
2 installsRemote functions reactive UI patterns. Use for smooth in-place updates, preventing page jumps, …
2 installsDaisyUI v5 form patterns. Use for inputs, selects, textareas, validation, and form structure wi…
2 installsSimilar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge F…
263K installsConverts Stitch designs into modular Vite and React components using system-level networking an…
50.7K installsGuide for building modern, accessible, and composable UI components. Use when building new comp…
12.5K installsTurn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when…
12.4K installsAlso in this package
Other skills from spences10/devhub-crm.
npx skills add spences10/devhub-crm
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md1,830 B -
docs
README.md490 B -
docs
SUMMARY.md200 B
History
- First seen on skills.sh
- First recorded snapshot · 4 installs
SKILL.md
Component Testing Patterns
Quick Start
import { page } from 'vitest/browser';
import { render } from 'vitest-browser-svelte';
render(Button, { label: 'Click' });
await page.getByRole('button', { name: 'Click' }).click();
await expect.element(page.getByRole('button')).toBeInTheDocument();
Core Principles
- Locators, never containers:
page.getByRole()auto-retries - Semantic queries:
getByRole(),getByLabelText()for
accessibility
- Await assertions:
await expect.element(el).toBeInTheDocument() - Real browsers: Tests run in Playwright, not jsdom
Common Patterns
- Locators:
page.getByRole('button'),.first(),.nth(0),
.last()
- Interactions:
await input.fill('text'),await button.click() - Runes: Use
.test.svelte.tsfiles,flushSync(),untrack() - Files:
.svelte.test.ts(browser),.ssr.test.ts(SSR),
*.test.ts (server)
References
- [setup-configuration.md](references/setup-configuration.md) -
Complete Vitest browser setup
- [testing-patterns.md](references/testing-patterns.md) -
Comprehensive testing patterns
- [locator-strategies.md](references/locator-strategies.md) - Semantic
locator guide
- [troubleshooting.md](references/troubleshooting.md) - Common issues
and fixes
<!-- PROGRESSIVE DISCLOSURE GUIDELINES:
- Keep this file ~50 lines total (max ~150 lines)
- Use 1-2 code blocks only (recommend 1)
- Keep description <200 chars for Level 1 efficiency
- Move detailed docs to references/ for Level 3 loading
- This is Level 2 - quick reference ONLY, not a manual
-->