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.
This commit is contained in:
Claude 2025-12-10 11:04:16 +00:00
parent d2a35a6e7b
commit a0cc8bd41b
No known key found for this signature in database

View file

@ -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)