feat(tui): expand unit & integration test coverage #82

Merged
charles merged 1 commit from tui/tests-46 into main 2026-04-11 20:43:46 +00:00
Owner

Stacks on #81. Closes charles/loom#46.

Adds 4 cross-cutting tests covering the app→config→screens seams that weren't caught by the per-ticket unit tests:

  • Lazy screen construction (navigate → visited screen map grows by exactly one per unique destination)
  • AppAction::Navigate routed via the unbounded channel
  • compute_layout stays valid on a 40×10 minimum terminal with both sidebar and notification row visible
  • End-to-end pipeline: LoomTuiConfig::default() → build_key_map → App::with_config runs without the terminal

113 total tests, all passing under cargo test -p loom-tui and green under cargo clippy -p loom-tui --all-targets -- -D warnings.

Out of scope

  • TestBackend snapshot-style integration tests for each screen. Those need either a lib.rs or [lib] section on the crate so integration tests can see the private types, and are best done after the glue PR wires PluginBridge/EventBus through AppCtx — otherwise most screens have nothing to snapshot but the stub placeholder
Stacks on #81. Closes charles/loom#46. Adds 4 cross-cutting tests covering the app→config→screens seams that weren't caught by the per-ticket unit tests: - Lazy screen construction (navigate → visited screen map grows by exactly one per unique destination) - `AppAction::Navigate` routed via the unbounded channel - `compute_layout` stays valid on a 40×10 minimum terminal with both sidebar and notification row visible - End-to-end pipeline: `LoomTuiConfig::default() → build_key_map → App::with_config` runs without the terminal 113 total tests, all passing under `cargo test -p loom-tui` and green under `cargo clippy -p loom-tui --all-targets -- -D warnings`. ## Out of scope - `TestBackend` snapshot-style integration tests for each screen. Those need either a `lib.rs` or `[lib]` section on the crate so integration tests can see the private types, and are best done after the glue PR wires `PluginBridge`/`EventBus` through `AppCtx` — otherwise most screens have nothing to snapshot but the stub placeholder
Adds four new cross-cutting tests covering:

- App navigation lazy-constructs each screen at most once and
  returning to an already-visited screen does not spawn a duplicate
  (#16 lazy construction contract)
- Drain_actions routes AppAction::Navigate through the channel
  correctly (#16 action routing)
- compute_layout produces non-degenerate rects even on an 40x10
  minimum terminal with both sidebar and notification row visible
  (#17 layout robustness)
- End-to-end config-to-app pipeline — mirrors what main::run does:
  load LoomTuiConfig defaults, build_key_map, construct an App with
  the result. Catches any future breakage in the startup plumbing
  without needing a real terminal (#43 integration)

113 total tests.

Closes charles/loom#46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
charles changed target branch from tui/just-ci-44 to main 2026-04-11 20:43:44 +00:00
charles deleted branch tui/tests-46 2026-04-11 20:43:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom!82
No description provided.