Tracking Issue: Tasks Component Test Improvements
Overview
This is a tracking issue to organize the work for adding comprehensive tests to the Tasks component in smaller, reviewable PRs. Breaking down the original PR.
Related to: #300
Tasks Component Tests
- [x] Keyboard Navigation Tests
- [ ] Priority Editing Tests
- [ ] Recur Editing Tests
- [ ] Reports Toggle Tests
- [ ] Annotation Tests
- [ ] Sorting
- [ ] Add Task Submission
Shared Test Utilities (Reorg)
- [ ] Create
test-utils/helper.ts - [ ] Create
test-utils/setup.tsx
PRs
| Task | PR | Status | Feedback |
|---|---|---|---|
| Reorganize into proper describe blocks | #435 | Close | not needed now(split needed) |
| Keyboard Navigation Tests | #434 | Merged | |
| Recur tests | - | - | |
| Priority tests | #461 | Open | |
| Reports tests | - | - |
Do change this to separate checklist for each component for which tests are yet to be added or updated. And the reorg tasks as well
Added Reports Toggle tests, opening a PR now
Hi @its-me-abhishek,
I've implemented unit test coverage for the Recur Editing checklist item in Tasks and opened a focused PR: #479.
The test suite covers:
- Saving recurrence frequencies: Verifies that valid recurrence values (
weekly,monthly, etc.) are correctly persisted througheditTaskOnBackend. - Handling
none: Ensures that selectingnonetriggers the guard logic and prevents unnecessary API requests. - Cancel functionality: Verifies that clicking Cancel discards the changes and restores the original recurrence state without invoking the backend.
All tests are passing locally, and no production code has been modified.
Happy to address any feedback. Thanks!
Hi @its-me-abhishek,
Following up on the Recur tests (#479), I've also implemented unit test coverage for the Annotation Editing checklist item in Tasks and opened a PR: #480 .
The test suite covers:
- Adding annotations: Verifies that entering an annotation and pressing Enter correctly adds it and persists it to the backend via
handleSaveAnnotations/editTaskOnBackend. - Removing annotations: Ensures that clicking the inline removal button (
✖) removes the annotation fromeditedAnnotationsbefore saving. - Input validation: Verifies that empty or whitespace-only inputs are ignored and do not create empty annotation badges.
- Cancel functionality: Ensures that clicking Cancel dismisses the editor without triggering unnecessary API calls.
All 4 test cases are passing locally, and the complete Tasks test suite passes with 10 tests across 3 test files.
Happy to address any reviews and feedback. Thanks!