specs/011-dashboard-testing/checklists/requirements.md
Ref: Size: 2.0 KiB
# Requirements Checklist: 010-dashboard-testing ## Functional Requirements - [x] **FR-001**: App struct and its enums (Tab, Pane, ViewMode) MUST be accessible from test code, either via pub(crate) visibility or an in-module test submodule - [x] **FR-002**: Unit tests MUST cover all state-mutating methods: move_selection, switch_tab, toggle show_all, toggle ViewMode, pane switching - [x] **FR-003**: Unit tests MUST verify boundary conditions: selection at 0 moving up, selection at last moving down, empty lists - [x] **FR-004**: Render tests MUST use ratatui::backend::TestBackend to capture rendered output without a real terminal - [x] **FR-005**: Render tests MUST verify presence of key UI elements (tab bar, list items, detail content, footer) in the buffer - [x] **FR-006**: Integration tests MUST support feeding sequences of key events through the key-handling logic - [x] **FR-007**: All tests MUST be isolated -- no shared mutable state between tests - [x] **FR-008**: Tests requiring git repos MUST use tempfile + git2::Repository::init for ephemeral repos - [x] **FR-009**: Tests MUST NOT require a real terminal or user interaction - [x] **FR-010**: All tests MUST pass with `cargo test` and produce no warnings with `cargo clippy` ## User Stories - [x] **US-001 (P1)**: Unit test App state transitions (key handling, mode changes, filtering) without rendering - [x] **US-002 (P2)**: Snapshot/render tests to verify TUI output for known states - [x] **US-003 (P3)**: Integration tests that simulate key sequences and verify final state ## Success Criteria - [x] **SC-001**: At least 10 unit tests covering all App state transition methods pass in `cargo test` - [x] **SC-002**: At least 3 render/snapshot tests verify TUI layout for different App states - [x] **SC-003**: At least 2 integration tests verify multi-step key sequences produce correct final state - [x] **SC-004**: All tests complete in under 5 seconds total - [x] **SC-005**: Zero clippy warnings in test code - [x] **SC-006**: Tests run successfully in CI without a real terminal (headless)