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
-
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.
-
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
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
Implementation units
Test infrastructure:
First tests:
References