원클릭으로
chromatic-snapshots
Guide for diagnosing and fixing snapshot failures, flakiness, and comparison issues in Chromatic.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Guide for diagnosing and fixing snapshot failures, flakiness, and comparison issues in Chromatic.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Write end-to-end tests using Playwright. Test user behavior, not implementation details. Also useful for non-test Playwright scripting.
Write React components following idiomatic patterns, hooks best practices, and performance optimizations
Write React components designed to be easily tested with Playwright and Testing Library — semantic HTML, clear boundaries, no test-specific hacks
| name | chromatic-snapshots |
| description | Guide for diagnosing and fixing snapshot failures, flakiness, and comparison issues in Chromatic. |
Stable snapshots are the foundation of visual regression testing. Every inconsistency you eliminate prevents a false positive from blocking your team.
Activate when you encounter:
| Symptom | Root Cause | Fix |
|---|---|---|
| Blank snapshot | animateIn effect or position: fixed without dimensions | Add chromatic: { delay: 300 } or wrap in a sized container |
| Missing images/fonts | Resource didn't load within 15s timeout | Serve as static files or use a placeholder service |
| Content cut off vertically | overflow: hidden or height: 100vh on ancestor | Remove overflow constraint or set explicit height via decorator |
| Portal not captured | Component renders outside viewport | Reposition component or adjust viewport size via modes |
| Mocked data not appearing | MSW handler mismatch or loading state captured | Add interaction test assertions; match API path only in handlers |
| Ignored elements still diff | Baseline and new snapshot have different dimensions | Ensure ignored elements keep identical dimensions across builds |
delay)seedrandom or mockdate to eliminate non-determinism (dates, IDs, random data).storybook/preview-head.htmlisChromatic() to conditionally stabilize behavior only in Chromatic100vh) shows all content| Option | Purpose |
|---|---|
chromatic: { delay: <ms> } | Wait before capturing |
chromatic: { pauseAnimationAtEnd: false } | Pause CSS animation at first frame |
chromatic: { diffThreshold: <0-1> } | Sensitivity of pixel comparison |
.chromatic-ignore / data-chromatic="ignore" | Exclude region from diff |
isChromatic() | Detect Chromatic environment at runtime |
staticDirs (Storybook config) | Serve local assets for stories |
For deeper guidance, load these companion files:
DEBUGGING-GUIDE.md — Full 9-step debugging workflow, Trace Viewer usage, MSW diagnosticsFLAKY-SNAPSHOTS.md — Flakiness causes, rerun workflow, prevention checklistEXAMPLES.md — Code examples for delay, animations, assertions, and ignoring elements