You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The frontend has no approval/golden-master snapshot testing. Components can change rendering output without detection. The backend already has approvaltests and pytest-approvaltests — the frontend has nothing equivalent.
Superficial noise (Svelte scoped class hashes, dynamic IDs, attribute ordering, timestamps) makes naive HTML snapshot testing brittle. We need a testing approach that ignores cosmetic noise while catching meaningful regressions.
Proposal
Implement approval testing using Vitest's native snapshot capabilities (v4.1.4+). No new test framework dependencies needed — we already have Vitest, @vitest/browser, and Playwright installed.
Three complementary strategies:
1. ARIA Snapshots (primary — semantic structure)
Capture the accessibility tree, not raw HTML
Immune to CSS class changes, attribute ordering, DOM restructuring
Regex patterns for dynamic content, preserved across --update
Catches accessibility regressions as a side benefit
2. HTML Snapshots with Scrubber (secondary — exact markup)
Custom scrubHtml() utility strips noisy attributes before comparison
toMatchFileSnapshot() for readable .html snapshot files
For cases where exact DOM structure matters
3. Screenshot Visual Regression (future)
toMatchScreenshot() in browser mode
Pixel-level comparison, higher maintenance, defer to later phase
Researched Approvals.NodeJS and approvaltests.Python (which we use in backend). For the frontend, Vitest 4.1.4+ provides equivalent functionality natively:
Feature
Approvals.NodeJS
Vitest Native
Scrubbers
Custom functions
Custom Domain Adapter API
ARIA snapshots
No
Built-in
Screenshot comparison
No
Built-in
Regex pattern preservation
No
Yes (--update preserves patterns)
Reporter/diff integration
Custom reporters
Built-in (vscode, gitdiff, etc.)
New dependency
Yes (approvals)
No
Impact
Quality: Catch unintended rendering changes in PR review
Accessibility: ARIA snapshots double as a11y regression tests
DX: Inline snapshots visible in PR diff, u to update in watch mode
Zero new deps: Everything comes from Vitest 4.1.4+
Problem
The frontend has no approval/golden-master snapshot testing. Components can change rendering output without detection. The backend already has
approvaltestsandpytest-approvaltests— the frontend has nothing equivalent.Superficial noise (Svelte scoped class hashes, dynamic IDs, attribute ordering, timestamps) makes naive HTML snapshot testing brittle. We need a testing approach that ignores cosmetic noise while catching meaningful regressions.
Proposal
Implement approval testing using Vitest's native snapshot capabilities (v4.1.4+). No new test framework dependencies needed — we already have Vitest,
@vitest/browser, and Playwright installed.Three complementary strategies:
1. ARIA Snapshots (primary — semantic structure)
--update2. HTML Snapshots with Scrubber (secondary — exact markup)
scrubHtml()utility strips noisy attributes before comparisontoMatchFileSnapshot()for readable.htmlsnapshot files3. Screenshot Visual Regression (future)
toMatchScreenshot()in browser modeSub-Issues
Execution Order
Why Not Approvals.NodeJS
Researched
Approvals.NodeJSandapprovaltests.Python(which we use in backend). For the frontend, Vitest 4.1.4+ provides equivalent functionality natively:--updatepreserves patterns)approvals)Impact
uto update in watch mode