Problem
capture-routes.test.js mocks Playwright entirely and only tests the capture module in isolation. There are zero tests that run the full capture → compare → stage pipeline, even with a tiny synthetic fixture. Interface mismatches between modules (e.g. a field rename in the results JSON) would not be caught by unit tests.
Proposed fix
Add one integration test that exercises the full data flow using pre-built PNG fixtures (no live browser needed):
- Write a minimal
snapdrift.json config with 1–2 routes
- Place small pre-built PNG files in the expected
screenshots/ location (bypassing Playwright entirely)
- Run
generateDriftReport() directly against the fixture screenshots
- Assert that the output
visual-diff-summary.json has the correct shape and values
- Optionally stage the bundle and verify the artifact structure
This tests the compare-results → stage-artifacts interface without needing a running browser.
Scope
- New
tests/integration/capture-compare-pipeline.test.js
- Small PNG fixture files in
tests/fixtures/
Effort
Medium — requires PNG fixture generation and careful test setup, but no new lib code needed.
Problem
capture-routes.test.jsmocks Playwright entirely and only tests the capture module in isolation. There are zero tests that run the fullcapture → compare → stagepipeline, even with a tiny synthetic fixture. Interface mismatches between modules (e.g. a field rename in the results JSON) would not be caught by unit tests.Proposed fix
Add one integration test that exercises the full data flow using pre-built PNG fixtures (no live browser needed):
snapdrift.jsonconfig with 1–2 routesscreenshots/location (bypassing Playwright entirely)generateDriftReport()directly against the fixture screenshotsvisual-diff-summary.jsonhas the correct shape and valuesThis tests the
compare-results→stage-artifactsinterface without needing a running browser.Scope
tests/integration/capture-compare-pipeline.test.jstests/fixtures/Effort
Medium — requires PNG fixture generation and careful test setup, but no new lib code needed.