Skip to content

Commit

Permalink
Add test on destroyEvents call
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrandda committed Aug 22, 2024
1 parent 66af01a commit 241ab09
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server/test/services/caldav/lib/calendar/syncUserCalendars.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('CalDAV sync', () => {
syncUserCalendars,
formatCalendars,
formatEvents,
formatRecurringEvents: sinon.stub().returns([]),
requestCalendars: sinon.stub(),
requestChanges: sinon.stub(),
requestEventsData: sinon.stub(),
Expand All @@ -37,6 +38,7 @@ describe('CalDAV sync', () => {
.stub()
.withArgs('event-to-delete')
.resolves(),
destroyEvents: sinon.stub().resolves(),
},
variable: {
getValue: sinon.stub(),
Expand Down Expand Up @@ -181,6 +183,19 @@ describe('CalDAV sync', () => {
start: new Date('2018-06-08 00:00:00.000 +00:00'),
location: null,
},
{
type: 'VEVENT',
uid: '3a98f1eb-e8e9-4f09-8454-353e92f9ff0d',
summary: 'Evenement 4 to update with rrule',
start: new Date('2018-06-08 00:00:00.000 +00:00'),
location: null,
href: '/home/personal/event-4.ics',
rrule: {
options: {
until: '2019-06-08 00:00:00.000 +00:00',
},
},
},
]);

sync.gladys.calendar.getEvents
Expand Down Expand Up @@ -251,6 +266,7 @@ describe('CalDAV sync', () => {
expect(sync.gladys.calendar.update.callCount).to.equal(1);
expect(sync.gladys.calendar.getEvents.callCount).to.equal(4);
expect(sync.gladys.calendar.destroyEvent.callCount).to.equal(1);
expect(sync.gladys.calendar.destroyEvents.callCount).to.equal(1);
});

it('should failed if no CALDAV_HOST', async () => {
Expand Down

0 comments on commit 241ab09

Please sign in to comment.