Skip to content

Make the snapshot suite use the existing restore test fixture #8349

Closed

Description

@jyaunches

Objective

Reduce repeated snapshot mocks and bring snapshot.test.ts below the repository's 1,500-line test-file limit.

Evidence

  • src/lib/actions/sandbox/snapshot.test.ts is exactly 1,500 lines.
  • It repeats mock modules, response builders, lifecycle mocks, registry mocks, and reset logic already present in src/lib/actions/sandbox/snapshot-restore-test-fixture.ts.
  • test/support/snapshot-policy-test-fixture.ts remains the owner of baseline-policy selection.

Scope

  • Import existing restore-fixture exports into snapshot.test.ts.
  • Add only the missing fixture exports required by current snapshot tests.
  • Keep scenario inputs, test titles, and assertions in snapshot.test.ts.
  • Preserve independent mock reset between tests.
  • Do not change snapshot or restore production behavior.

Relationships

This is not a good first issue: hoisted mocks and snapshot lifecycle behavior require broader test context.

Acceptance criteria

  • snapshot.test.ts is below the repository limit.
  • Shared mock state is fresh for each test.
  • Existing snapshot and restore behavior remains covered.
  • The change has a negative net LOC delta.

Validation

npx vitest run --project cli src/lib/actions/sandbox/snapshot.test.ts src/lib/actions/sandbox/snapshot-restore-*.test.ts
npm run typecheck:cli
npm run test:projects:check

Activity

  1. added
    help wanted
    area: sandbox
    on Aug 5, 2026
  2. added theissue type on Aug 5, 2026
  3. self-assigned this
    on Aug 6, 2026
  4. added a commit that references this issue on Aug 6, 2026
    66f663a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: sandboxhelp wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions