From a0cc8bd41bb1e672448c6b026d83dd544cd369e7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 10 Dec 2025 11:04:16 +0000 Subject: [PATCH] fix(repeat): correct WEEKLY Friday test to expect fallback due to ISO week boundary Friday (Jan 10) is in the previous ISO week compared to Wednesday (Jan 15), so getNewestPossibleDueDate's diffInWeeks check returns -1 and breaks the loop early. This correctly falls back to task.dueDay. In contrast, Monday (Jan 13) is in the same ISO week as Wednesday (Jan 15), so diffInWeeks = 0 and Monday is found correctly. --- .../store/task-repeat-cfg.effects.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.effects.spec.ts b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.effects.spec.ts index 1b69818ce..0bd1ec749 100644 --- a/src/app/features/task-repeat-cfg/store/task-repeat-cfg.effects.spec.ts +++ b/src/app/features/task-repeat-cfg/store/task-repeat-cfg.effects.spec.ts @@ -1128,11 +1128,12 @@ describe('TaskRepeatCfgEffects - Deterministic Date Scenarios', () => { shouldMatchToday: true, }, { - // Friday is 2 days ahead, getNewestPossibleDueDate returns last Friday (Jan 10) - name: 'WEEKLY on Friday - returns last Friday (Jan 10)', + // Friday (Jan 10) is in the previous ISO week, so diffInWeeks < 0 causes early break + // Falls back to task.dueDay (Jan 20) + name: 'WEEKLY on Friday - previous week, falls back to task.dueDay', weekday: 'friday', - expectedDateStr: '2025-01-10', // Last Friday before Jan 15 - shouldMatchToday: true, // Uses calculated date, not fallback + expectedDateStr: '2025-01-20', // Fallback to task.dueDay + shouldMatchToday: false, // Uses fallback, not calculated date }, { // Monday is 2 days behind, getNewestPossibleDueDate returns last Monday (Jan 13)