tui: unit & integration test suite #46

Closed
opened 2026-04-11 13:07:21 +00:00 by charles · 0 comments
Owner

User story

As a developer, I want automated unit and integration tests for every screen and subsystem, so that regressions are caught before merging.

Acceptance criteria

Unit tests

  • Coverage targets (enforced as part of PR review, not hard CI gate):
    • Image renderer protocol auto-detection logic (mock terminal capability matrix)
    • Kitty chunking and base64 framing
    • Half-block renderer deterministic output
    • Event loop routing and overlay stack
    • KeyCombo parsing / round-trip and chord handling
    • Command palette action registry & fuzzy ranking
    • Gallery grid column calculation
    • LoomTuiConfig load/save round-trip
    • Notification queue auto-dismiss with fake clock

Integration tests

  • One test per screen simulating a sequence of key events and asserting the resulting screen state (using a headless ratatui::backend::TestBackend)
  • Scenarios: Generate → run → queue; Gallery search/filter/sort; Entity create → inject; Presets apply; Settings edit + persist

CI

  • cargo test -p loom-tui runs and passes in the Forgejo qa job
  • cargo clippy -p loom-tui -- -D warnings runs and passes
  • loom-core tests remain passing (spec §9 no-regression requirement)

Out of scope

  • End-to-end tests against a live diffusion backend (impractical in CI)
  • Performance benchmarks

References

  • Spec §9 "Testing Requirements"
## User story As a developer, I want automated unit and integration tests for every screen and subsystem, so that regressions are caught before merging. ## Acceptance criteria ### Unit tests - [ ] Coverage targets (enforced as part of PR review, not hard CI gate): - Image renderer protocol auto-detection logic (mock terminal capability matrix) - Kitty chunking and base64 framing - Half-block renderer deterministic output - Event loop routing and overlay stack - `KeyCombo` parsing / round-trip and chord handling - Command palette action registry & fuzzy ranking - Gallery grid column calculation - `LoomTuiConfig` load/save round-trip - Notification queue auto-dismiss with fake clock ### Integration tests - [ ] One test per screen simulating a sequence of key events and asserting the resulting screen state (using a headless `ratatui::backend::TestBackend`) - [ ] Scenarios: Generate → run → queue; Gallery search/filter/sort; Entity create → inject; Presets apply; Settings edit + persist ### CI - [ ] `cargo test -p loom-tui` runs and passes in the Forgejo `qa` job - [ ] `cargo clippy -p loom-tui -- -D warnings` runs and passes - [ ] `loom-core` tests remain passing (spec §9 no-regression requirement) ## Out of scope - End-to-end tests against a live diffusion backend (impractical in CI) - Performance benchmarks ## References - Spec §9 "Testing Requirements"
charles added this to the loom-tui v0.1.0 milestone 2026-04-11 13:07:21 +00:00
Sign in to join this conversation.
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#46
No description provided.