Skip to content

Add TUI UI and CLI I/O tests #19

Description

@WTW0313

Context

Skillpack needs test coverage for the Ink TUI and the CLI process contract without coupling UI tests to provider scanning or user directories.

Agreed approach

  • Split Terminal UI Tests from CLI I/O Tests.
  • Terminal UI Tests render an injectable app surface with Ink Testing Library, shared inventory fixtures, fixed terminal sizes, normalized output, and a mock SkillManager.
  • CLI I/O Tests exercise an injectable CLI runner for stdin/stdout, alternate screen buffer control, signal handlers, render lifecycle, and process exit.
  • Keep only a thin process-level smoke test for the built binary.
  • Use snapshots only for stable normalized golden frames; use semantic assertions for interaction behavior.
  • First phase covers navigation, detail routing, search, help, terminal envelope states, and entry/confirmation state for toggle/update/remove/install flows.
  • Do not run real provider mutations, external skills commands, system file manager opens, or real signals inside the Vitest process.

Implementation units

  1. Test infrastructure:

    • Add ink-testing-library as a TUI devDependency.
    • Extract an injectable AppSurface while keeping App responsible for real manager initialization.
    • Extract runSkillpackCli for terminal lifecycle and process I/O.
    • Add TUI test harness, inventory fixtures, output normalization, and deterministic cleanup.
  2. First tests:

    • Inventory initial frame snapshot.
    • Keyboard navigation, detail routing, search, help overlay.
    • Too-small terminal state.
    • Toggle/update/remove/install entry or confirmation state.
    • CLI I/O runner output ordering and lifecycle tests.

References

  • ADR: docs/adr/0038-split-tui-ui-tests-from-cli-io-tests.md
  • Test guide: packages/tui/tests/README.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified and ready for an AFK agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions