Description
VisualRegressionTester in apps/backend/tests/visual/preview.visual.test.ts generates mock screenshots but no baselines are stored. Without baselines, the diff threshold check is never exercised and visual regressions go undetected.
Requirements and context
- Must be secure, tested, and documented where applicable
- Should stay reviewable and fit the current monorepo structure
- Relevant files:
apps/backend/tests/visual/preview.visual.test.ts
Suggested execution
- Create branch:
issue-015-visual-regression-baselines-deployment-preview
- Keep changes scoped to the issue and reference the task IDs in the PR
Implement changes
- Run
storeBaseline for each template category (dex, defi, payment, asset) and commit the outputs
- Add a CI step that runs
compareWithBaseline and fails on diff > threshold
- Document the baseline update workflow in a
CONTRIBUTING.md section
Test and commit
- Confirm
compareWithBaseline returns within threshold for unchanged templates
- Include before/after screenshots in the PR for each template category
- Edge case: baseline file missing — test should fail with a clear message, not silently pass
Example commit message
test(visual): store initial baselines for deployment preview
Guidelines
- Prefer small, reviewable PRs
- Keep naming and data contracts consistent with the spec docs
Description
VisualRegressionTesterinapps/backend/tests/visual/preview.visual.test.tsgenerates mock screenshots but no baselines are stored. Without baselines, the diff threshold check is never exercised and visual regressions go undetected.Requirements and context
apps/backend/tests/visual/preview.visual.test.tsSuggested execution
issue-015-visual-regression-baselines-deployment-previewImplement changes
storeBaselinefor each template category (dex, defi, payment, asset) and commit the outputscompareWithBaselineand fails on diff > thresholdCONTRIBUTING.mdsectionTest and commit
compareWithBaselinereturns within threshold for unchanged templatesExample commit message
Guidelines