Repository navigation
test(Tasks): add unit tests for recur editing dialog and state transitions - #479
Open
Aspirant200715 wants to merge 1 commit into
Open
Aspirant200715 wants to merge 1 commit into
Aspirant200715 wants to merge 1 commit into
Conversation
|
Thank you for opening this PR! Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools. Please take a moment to:
More information on how to conduct a self review: This helps make the review process smoother and gives us a clearer understanding of your thought process. Once you've added your self-review, we'll continue from our side. Thank you! |
Author
Self-Review
Ready for review. Thanks! |
This was referenced Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds unit test coverage for the Recurrence Editing workflow in the
Taskscomponent, addressing the remaining checklist item in tracking issue #433.Following the modular testing structure established in #461 and #467, these tests verify the interaction between
Tasks.tsx,TaskDialog.tsx, and the shared test utilities (test-utils/setup.tsxandtest-utils/helper.ts).Technical Context & Component Workflow
1. Dialog & Selection (
TaskDialog.tsx)editState.isEditingRecur, mounting the mocked<Select>component.daily,weekly,monthly,yearly, ornone) updateseditState.editedRecur.2. Persistence Guard & Backend Dispatch (
Tasks.tsx)handleRecurSaveClick(task, editState.editedRecur).editedRecuris'none'or empty, it exits edit mode by settingisEditingRecur: falsewithout triggering an unnecessary backend mutation.task.recur.unsyncedTaskUuids.handleEditTaskOnBackend.hooks.editTaskOnBackendwith the updated Taskwarrior payload.3. Cancel Transition
isEditingRecurand restoreseditedRecurtooriginalRecur.Tests Implemented
Test file:
frontend/src/components/HomeComponents/Tasks/__tests__/Tasks/Recur.test.tsxThree test cases have been added:
should save selected recur value to backendweekly) and clicks Save.hooks.editTaskOnBackendis called withrecur: 'weekly'in the payload.should not call backend when none is selected'none'and clicks Save.editTaskOnBackendis never called.should cancel editing recur without calling backendRelated issue: #433
Checklist
npm test -- src/components/HomeComponents/Tasks/__tests__/Tasks/Recur.test.tsx(3 tests passed).npm test -- --runInBand src/components/HomeComponents/Tasks/__tests__/Tasks/(6 tests passed)..githooks/pre-commit.Test Plan & Verification
All tests were executed locally using Jest from the
frontend/directory.Summary
This PR focuses exclusively on testing the existing recurrence editing functionality without introducing production code changes.
It covers the successful persistence path, the
'none'recurrence guard, and the cancellation flow, ensuring that both state transitions and backend interactions behave as expected.