Summary
AlertHistory in src/sentinel/history.rs has filtering methods but no test coverage for the query() method, especially for filter combinations and pagination edge cases.
What To Do
Add ~15-20 unit tests covering:
- Single filters: priority alone, block range alone, pattern type alone
- Combined filters: all three filters at once
- Pagination: correct items per page, page boundaries, page > total_pages, page_size clamping (>100)
- Edge cases: empty file, invalid JSON lines, zero matching alerts
- Sort order: verify Newest vs Oldest ordering
Files
src/sentinel/history.rs (add tests at bottom)
Acceptance Criteria
Estimated Effort
~150-200 lines of test code, 2-3 hours
Summary
AlertHistoryinsrc/sentinel/history.rshas filtering methods but no test coverage for thequery()method, especially for filter combinations and pagination edge cases.What To Do
Add ~15-20 unit tests covering:
Files
src/sentinel/history.rs(add tests at bottom)Acceptance Criteria
cargo test --all-features)Estimated Effort
~150-200 lines of test code, 2-3 hours