Skip to content

Commit

Permalink
Improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrandda committed May 28, 2020
1 parent c8b9159 commit 8f00e1e
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions server/test/services/caldav/lib/calendar/requests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ describe('CalDAV requests', () => {
Request: sinon.stub().returns({ requestDate: 'request3' }),
},
ical: {
parseICS: sinon.stub().returns({
data: {
type: 'VEVENT',
uid: '49193db9-f666-4947-8ce6-3357ce3b7166',
summary: 'Evenement 1',
start: new Date('2018-06-08'),
end: new Date('2018-06-09'),
},
}),
parseICS: sinon
.stub()
.onFirstCall()
.returns({
data: {
type: 'VEVENT',
uid: '49193db9-f666-4947-8ce6-3357ce3b7166',
summary: 'Evenement 1',
start: new Date('2018-06-08'),
end: new Date('2018-06-09'),
},
})
.onSecondCall()
.returns({}),
},
xmlDom: {
DOMParser: sinon.stub().returns({
Expand Down Expand Up @@ -88,6 +93,19 @@ describe('CalDAV requests', () => {
{ tagName: 'href', childNodes: [{ data: 'https://caldav.host.com/home/personal/event-1.ics' }] },
]),
},
{
tagName: 'response',
getElementsByTagName: sinon.stub().returns([
{
tagName: 'calendar-data',
childNodes: [
{
data: '',
},
],
},
]),
},
]),
}),
}),
Expand Down

0 comments on commit 8f00e1e

Please sign in to comment.