Summary
The audit-utils test suite in frontend-pwa/scripts/audit-utils.test.mjs validates advisory response structures using explicit toEqual assertions, but lacks snapshot tests for complex nested advisory payloads. This was identified as out of scope during the refactoring in PR #350 but should be addressed as a follow-up.
Background
During review of PR #350 (#350), the Testing (Compile-Time / UI) check flagged that whilst the suite tests structured JSON audit output, it does not include snapshot assertions for complex nested advisory structures. Snapshot tests would catch unexpected regressions in the shape of advisory data returned by the bulk advisory endpoint fallback.
Acceptance criteria
- Introduce Vitest snapshot tests (e.g.
expect(result).toMatchSnapshot()) for at least one complex advisory payload in frontend-pwa/scripts/audit-utils.test.mjs.
- Snapshots should cover the normalised advisory structure produced by the bulk advisory fallback path (e.g. the
'falls back to the bulk advisory endpoint' test case).
- Existing semantic assertions (
toEqual, toHaveBeenNthCalledWith, etc.) must be retained alongside the new snapshots.
pnpm exec vitest run scripts/audit-utils.test.mjs passes with no failures.
References
Summary
The audit-utils test suite in
frontend-pwa/scripts/audit-utils.test.mjsvalidates advisory response structures using explicittoEqualassertions, but lacks snapshot tests for complex nested advisory payloads. This was identified as out of scope during the refactoring in PR #350 but should be addressed as a follow-up.Background
During review of PR #350 (#350), the Testing (Compile-Time / UI) check flagged that whilst the suite tests structured JSON audit output, it does not include snapshot assertions for complex nested advisory structures. Snapshot tests would catch unexpected regressions in the shape of advisory data returned by the bulk advisory endpoint fallback.
Acceptance criteria
expect(result).toMatchSnapshot()) for at least one complex advisory payload infrontend-pwa/scripts/audit-utils.test.mjs.'falls back to the bulk advisory endpoint'test case).toEqual,toHaveBeenNthCalledWith, etc.) must be retained alongside the new snapshots.pnpm exec vitest run scripts/audit-utils.test.mjspasses with no failures.References