mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-22 18:30:09 +00:00
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:
parent
d2a35a6e7b
commit
a0cc8bd41b
1 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue