Skip to content

Consolidate messaging-plan test builders #8357

Closed

Description

@jyaunches

Objective

Use one canonical valid messaging-plan builder across root and source tests.

Evidence

Overlapping plan construction remains in:

  • test/helpers/messaging-plan-fixtures.ts
  • test/messaging-plan-test-helper.ts
  • test/messaging-plan-image-boundary.test.ts
  • src/lib/onboard/machine/handlers/policies-test-fixtures.ts

The policy-handler fixture must first become an active consumer in #8347 so this issue can change the shared builder contract against all known consumers.

Scope

  • Select one owner for the valid-plan baseline.
  • Preserve workflow, channel, credential, policy, and image-boundary scenario values at each call site.
  • Return fresh nested arrays and objects for every call.
  • Keep invalid plans and behavior assertions local.
  • Do not introduce a generic mock DSL.

Relationships

Acceptance criteria

  • One builder owns the valid messaging-plan baseline.
  • Every consumer receives fresh nested state.
  • Explicit invalid plans remain at their call sites.
  • Test titles and behavior remain unchanged.
  • The change has a negative net LOC delta.

Validation

Run the affected integration messaging-plan suites and:

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
npm run test:projects:check

Activity

  1. added
    help wanted
    area: messaging
    on Aug 5, 2026
  2. added theissue type on Aug 5, 2026
  3. added a commit that references this issue on Aug 7, 2026
    28668e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: messaginghelp wanted

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions