Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion test/unit/request/calendar_query_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ suite('request.calendarQuery', function() {
yield mock.verify(send);
}));

test('should add specified props to report body', co.wrap(function *() {
test('should add single prop to report body', co.wrap(function *() {
let mock = nockWrapper('http://127.0.0.1:1337')
.matchRequestBody('/principals/admin/', 'REPORT', body => {
return body.indexOf('<d:catdog />') !== -1;
Expand All @@ -45,6 +45,23 @@ suite('request.calendarQuery', function() {
yield mock.verify(send);
}));

test('should add multiple props to report body', co.wrap(function *() {
let mock = nockWrapper('http://127.0.0.1:1337')
.matchRequestBody('/principals/admin/', 'REPORT', body => {
return body.indexOf('<d:catdog /><d:winslow />') === -1;
});

let req = calendarQuery({
props: [
{ name: 'catdog', namespace: ns.DAV },
{ name: 'winslow', namespace: ns.DAV },
]
});

let send = xhr.send(req, 'http://127.0.0.1:1337/principals/admin/');
yield mock.verify(send);
}));

test('should add specified filters to report body', co.wrap(function *() {
let mock = nockWrapper('http://127.0.0.1:1337')
.matchRequestBody('/principals/admin/', 'REPORT', body => {
Expand Down