Skip to content

Commit

Permalink
Add test cases for period RDATEs
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed May 1, 2024
1 parent d63536d commit ba24005
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions samples/recur_instances.ics
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ BEGIN:VEVENT
UID:623c13c0-6c2b-45d6-a12b-c33ad61c4868
DESCRIPTION:IAM FOO
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1TU
RDATE:20231123T090000Z
RDATE;VALUE=PERIOD:20231125T090000Z/20231125T123000Z
SUMMARY:Crazy Event Thingy!
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Sahaja
Lal;X-NUM-GUESTS=0:mailto:[email protected]
Expand Down
10 changes: 7 additions & 3 deletions test/recur_expansion_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ suite('recur_expansion', function() {
let expected = [
new Date('2012-11-05T18:00:00.000Z'),
new Date('2012-11-10T18:00:00.000Z'),
new Date('2012-11-30T18:00:00.000Z')
];
new Date('2012-11-30T18:00:00.000Z'),

// RDATEs
new Date('2023-11-23T09:00:00.000Z'),
new Date('2023-11-25T09:00:00.000Z')
];

let dates = subject.ruleDates.map(function(time) {
return time.toJSDate();
// We have a period in here, take the start date
return (time.start || time).toJSDate();
});

assert.deepEqual(dates, expected);
Expand Down

0 comments on commit ba24005

Please sign in to comment.