Prompt

I'm building a React design system and need visual regression testing for shared components

Technology / Testing & QA2 observationsLast seen Nov 12, 2026

Latest observation

Nov 12, 2026OpenAI APIWeb search: off

A solid setup for visual regression testing in a React design system is usually:

Recommended stack

  • Storybook for isolated component examples
  • Playwright or Chromatic for screenshot-based regression tests
  • CI to run comparisons on every PR

Best option for design systems: Storybook + Chromatic

If you want the simplest and most common workflow:

  1. Build components in Storybook
  2. Connect Storybook to Chromatic
  3. Chromatic captures baseline screenshots and compares changes on PRs

Why this works well

  • Easy for shared components
  • Works naturally with component variants/states
  • Great review workflow for designers and engineers
  • Minimal test maintenance

Alternative: Storybook + Playwright

If you want full control or want to avoid a SaaS tool:

  1. Create Storybook stories for each component state
  2. Use Playwright to open each story
  3. Take screenshots
  4. Compare against committed baselines

Pros

  • Full control
  • Can run locally and in CI
  • No vendor dependency

Cons

  • You manage baseline images, thresholds, flakiness, and review workflow
  • More setup than Chromatic

Suggested approach for a React design system

1. Create stories for every important state

For each shared component, include:

  • default
  • hover
  • active
  • disabled
  • loading
  • error
  • dark mode
  • responsive sizes
  • long text / edge cases

Example:

export const Default = {};
export const Disabled = {
  args: { disabled: true },
};
export const LongLabel = {
  args: { children: 'This is a very long button label' },
};

2. Standardize the visual environment

To reduce false positives:

  • lock viewport size
  • use consistent fonts
  • mock dates/time/network
  • freeze animations
  • disable transitions in test mode
  • use stable theme/provider wrappers

3. Decide what to compare

Usually compare:

  • component rendering
  • spacing
  • typography
  • colors
  • icon alignment
  • truncation/overflow behavior

Avoid comparing:

  • live timestamps
  • random avatars
  • animated states unless intentionally tested

4. Run in CI

Your pipeline should:

  • build Storybook
  • run visual snapshots
  • upload results
  • fail on unexpected diffs

If you want a practical recommendation

For most React design systems:

Use Storybook + Chromatic first.
It gives the fastest path to value and is widely used for component libraries.

If you need self-hosted or custom control: Use Storybook + Playwright screenshot tests.


Good testing practices

  • Keep stories deterministic
  • Use one story per visual state
  • Test components in isolation, not whole pages
  • Review diffs manually before approving
  • Update baselines only when changes are intentional

If you want, I can give you:

  1. a step-by-step setup for Storybook + Chromatic, or
  2. a Playwright-based visual regression setup with example code.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.