economical-visual-tests

Consolidates component variants and states into gallery stories to reduce billed visual snapshots.

21|1|Updated Jul 22, 2026
One-click install
npx skills add https://github.com/uiverify/uiverify --skill economical-visual-tests-uiverify
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: economical-visual-tests
Source: https://github.com/uiverify/uiverify/tree/main/packages/skills/skills/economical-visual-tests
Command: npx skills add https://github.com/uiverify/uiverify --skill economical-visual-tests-uiverify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Per-snapshot visual testing tools bill and diff per rendered story, so writing one story per variant, state, or theme multiplies both cost and noise. A component with 5 sizes × 3 states × 2 themes becomes 30 snapshots the naive way, inflating the visual-testing bill and the flake surface. ## Core Features & Use Cases - Gallery stories: Render the entire size/variant/theme matrix in a single grid story so one snapshot covers every combination. - Data-driven states: Drive loading, empty, error, and loaded states from fixed fixtures or mocked responses in one story instead of one story per fetch state. - Granularity tradeoff guidance: Explains when to merge variants (shared component matrices) versus when to keep independent pages and flows separate to avoid coupling unrelated diffs. - Use Case: A Button component with 3 sizes × 3 variants collapses from 9 stories into one gallery story, cutting billed snapshots by roughly 90% while keeping full visual coverage. ## Quick Start Ask the agent to refactor my Button stories so all size and variant combinations render in a single gallery story instead of one story per combination.

Frequently Asked Questions about economical-visual-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce the number of visual testing snapshots?▼

Render all component variants together in a single gallery story using a grid layout, so one snapshot covers the entire matrix. Also drive loading, empty, and error states from fixtures in one data-driven story instead of separate stories per state.

How to test all component states in one Storybook story?▼

Define an array of fixture cases (empty, one item, many items, error) and map over them in a single story, rendering each state in its own labeled section. If the component fetches internally, mock the request so each state is deterministic.

Does this approach work with Chromatic, Percy, and Playwright screenshots?▼

Yes, the technique is tool-agnostic because all per-snapshot visual tools bill and diff per rendered story. Fewer stories means fewer billed snapshots and fewer places to flake regardless of which platform you use.

What are the downsides of merging variants into one snapshot?▼

Consolidation is coarser granularity: a diff anywhere in the gallery flags the whole story, and you lose per-variant baselines and accept controls. Keep genuinely independent pages and flows as separate stories to avoid coupling unrelated diffs.

When should I not consolidate visual test stories?▼

Avoid merging independent surfaces such as different pages or flows that evolve on their own timelines, since collapsing them couples unrelated diffs. Consolidation works best for pure component matrices like sizes, states, and themes of one component.