Skip to content

Commit 3a85ddd

Browse files
committed
test: - Add tests of Occurrence.getReferenceDate()
I learned in discussions about #3553 that no tests failed when that method was made to return dates in a different order.
1 parent 4e55a64 commit 3a85ddd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Task/Task.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,24 @@ describe('toggle done', () => {
10661066
nextScheduled: '2021-10-18',
10671067
nextDue: '2021-10-20',
10681068
},
1069+
{
1070+
// Prioritise due date over scheduled and start
1071+
interval: 'every month on the 15th',
1072+
due: '2025-08-16',
1073+
scheduled: '2025-08-11', // 5 days before old due
1074+
start: '2025-08-06', // 10 days before old due
1075+
nextDue: '2025-09-15', // The next '15th'
1076+
nextScheduled: '2025-09-10', // 5 days before new due
1077+
nextStart: '2025-09-05', // 10 days before the new due
1078+
},
1079+
{
1080+
// Prioritise scheduled date over start
1081+
interval: 'every month on the 15th',
1082+
scheduled: '2025-08-10',
1083+
start: '2025-08-05', // 5 days before the old scheduled
1084+
nextScheduled: '2025-08-15', // 5 days before new due
1085+
nextStart: '2025-08-10', // 5 days before the new scheduled
1086+
},
10691087
{
10701088
// every month - due 31 March, and so 31 April would not exist: it used to skip forward 2 months
10711089
interval: 'every month',

0 commit comments

Comments
 (0)