Skip to content

test: pin TUI route event cleanup against the real components #514

Description

@LeXwDeX

Why

event-cleanup.test.tsx (#502) pins the subscription seam with a RouteProbe that mirrors the production subscription shape: removing the onCleanup wrappers from the real Session/Prompt routes would leave the test green, so it does not protect the actual change it was written for.

Scope

  • packages/tui/test/cli/tui/event-cleanup.test.tsx (plus the existing sync-fixture.tsx harness if it needs extension).

Approach

  • Mount the REAL Session and Prompt route components inside the existing harness (per AGENTS.md TUI: SyncProvider requires Exit/Args/KV/SDK/Project providers), count event-bus listeners around mount/unmount, and assert unmount returns the count to the pre-mount baseline.
  • Keep the RouteProbe seam test as the context-level contract; the new tests are the production-shape protection.

Acceptance

  • Temporarily removing an onCleanup wrapper from routes/session/index.tsx or prompt/index.tsx makes the new test fail (verify locally, then restore); full TUI test suite green.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions