Skip to content

Make the primary policy-handler suite use its existing test fixture #8347

Closed

Description

@jyaunches

Objective

Make the primary policy-handler suite consume the fixture already used by its restricted-resume companion suite.

Evidence

  • src/lib/onboard/machine/handlers/policies.test.ts duplicates makeMessagingPlan, dependency construction, session mutation, and base options.
  • src/lib/onboard/machine/handlers/policies-test-fixtures.ts already owns those mechanics.
  • policies-restricted-resume.test.ts already consumes that fixture.

Scope

  • Replace the duplicate builders in policies.test.ts with fixture imports.
  • Preserve the primary suite's use of the real mergePolicyMessagingChannels; use a fixture override where required.
  • Keep test inputs, titles, and assertions in the suite.
  • Ensure mutable session and messaging-plan state is fresh for each test.

Relationships

Why this is a good first issue

The canonical fixture and a working consumer already exist. The change is limited to two adjacent test modules and preserves production behavior.

Acceptance criteria

  • policies.test.ts no longer defines the duplicate builders.
  • Both suites consume fresh fixture state.
  • The real merge function remains covered.
  • Test titles and behavior remain unchanged.
  • The change has a negative net LOC delta.

Validation

npx vitest run --project cli src/lib/onboard/machine/handlers/policies.test.ts src/lib/onboard/machine/handlers/policies-restricted-resume.test.ts
npm run typecheck:cli

Activity

  1. added
    good first issue
    help wanted
    area: onboarding
    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
    d137a5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: onboardinggood first issuehelp wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions