summaryrefslogtreecommitdiffstats
path: root/js/dav/test/unit/data
diff options
context:
space:
mode:
Diffstat (limited to 'js/dav/test/unit/data')
-rw-r--r--js/dav/test/unit/data/address_book_query.xml72
-rw-r--r--js/dav/test/unit/data/calendar_query.xml24
-rw-r--r--js/dav/test/unit/data/current_user_principal.xml13
-rw-r--r--js/dav/test/unit/data/index.js23
-rw-r--r--js/dav/test/unit/data/propfind.xml39
-rw-r--r--js/dav/test/unit/data/sync_collection.xml16
6 files changed, 187 insertions, 0 deletions
diff --git a/js/dav/test/unit/data/address_book_query.xml b/js/dav/test/unit/data/address_book_query.xml
new file mode 100644
index 00000000..3e7690b7
--- /dev/null
+++ b/js/dav/test/unit/data/address_book_query.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<d:multistatus xmlns:d="DAV:"
+ xmlns:s="http://sabredav.org/ns"
+ xmlns:cal="urn:ietf:params:xml:ns:caldav"
+ xmlns:cs="http://calendarserver.org/ns/"
+ xmlns:card="urn:ietf:params:xml:ns:carddav">
+ <d:response>
+ <d:href>/addressbooks/admin/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:supported-report-set>
+ <d:supported-report>
+ <d:report>
+ <d:expand-property/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <d:principal-property-search/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <d:principal-search-property-set/>
+ </d:report>
+ </d:supported-report>
+ </d:supported-report-set>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+ <d:response>
+ <d:href>/addressbooks/admin/default/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:supported-report-set>
+ <d:supported-report>
+ <d:report>
+ <d:expand-property/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <d:principal-property-search/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <d:principal-search-property-set/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <card:addressbook-multiget/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <card:addressbook-query/>
+ </d:report>
+ </d:supported-report>
+ <d:supported-report>
+ <d:report>
+ <d:sync-collection/>
+ </d:report>
+ </d:supported-report>
+ </d:supported-report-set>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+</d:multistatus>
diff --git a/js/dav/test/unit/data/calendar_query.xml b/js/dav/test/unit/data/calendar_query.xml
new file mode 100644
index 00000000..3a276b75
--- /dev/null
+++ b/js/dav/test/unit/data/calendar_query.xml
@@ -0,0 +1,24 @@
+<d:multistatus xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
+ <d:response>
+ <d:href>/calendars/johndoe/home/132456762153245.ics</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:getetag>"2134-314"</d:getetag>
+ <c:calendar-data>BEGIN:VCALENDAR
+END:VCALENDAR</c:calendar-data>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+ <d:response>
+ <d:href>/calendars/johndoe/home/132456-34365.ics</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:getetag>"5467-323"</d:getetag>
+ <c:calendar-data>BEGIN:VCALENDAR
+END:VCALENDAR</c:calendar-data>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+</d:multistatus>
diff --git a/js/dav/test/unit/data/current_user_principal.xml b/js/dav/test/unit/data/current_user_principal.xml
new file mode 100644
index 00000000..c1b3ead7
--- /dev/null
+++ b/js/dav/test/unit/data/current_user_principal.xml
@@ -0,0 +1,13 @@
+<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
+ <d:response>
+ <d:href>/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:current-user-principal>
+ <d:href>/principals/admin%40domain.tld/</d:href>
+ </d:current-user-principal>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+</d:multistatus>
diff --git a/js/dav/test/unit/data/index.js b/js/dav/test/unit/data/index.js
new file mode 100644
index 00000000..627a39b6
--- /dev/null
+++ b/js/dav/test/unit/data/index.js
@@ -0,0 +1,23 @@
+import fs from 'fs';
+import { format } from 'util';
+
+import camelize from '../../../lib/camelize';
+
+let docs = {};
+export default docs;
+
+[
+ 'address_book_query',
+ 'current_user_principal',
+ 'calendar_query',
+ 'propfind',
+ 'sync_collection'
+].forEach(function(responseType) {
+ var camelCase = camelize(responseType);
+ docs[camelCase] = fs
+ .readFileSync(
+ format('%s/%s.xml', __dirname, responseType),
+ 'utf-8'
+ )
+ .replace(/>\s+</g, '><'); // Remove whitespace between close and open tag.
+});
diff --git a/js/dav/test/unit/data/propfind.xml b/js/dav/test/unit/data/propfind.xml
new file mode 100644
index 00000000..274520c7
--- /dev/null
+++ b/js/dav/test/unit/data/propfind.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
+ <d:response>
+ <d:href>/calendars/admin/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:displayname/>
+ <cs:getctag/>
+ <cal:supported-calendar-component-set/>
+ </d:prop>
+ <d:status>HTTP/1.1 404 Not Found</d:status>
+ </d:propstat>
+ </d:response>
+ <d:response>
+ <d:href>/calendars/admin/default/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:displayname>default calendar</d:displayname>
+ <cs:getctag>http://sabre.io/ns/sync/0</cs:getctag>
+ <cal:supported-calendar-component-set>
+ <cal:comp name="VEVENT"/>
+ <cal:comp name="VTODO"/>
+ </cal:supported-calendar-component-set>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+ <d:response>
+ <d:href>/calendars/admin/outbox/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:displayname/>
+ <cs:getctag/>
+ <cal:supported-calendar-component-set/>
+ </d:prop>
+ <d:status>HTTP/1.1 404 Not Found</d:status>
+ </d:propstat>
+ </d:response>
+</d:multistatus>
diff --git a/js/dav/test/unit/data/sync_collection.xml b/js/dav/test/unit/data/sync_collection.xml
new file mode 100644
index 00000000..a2f805ce
--- /dev/null
+++ b/js/dav/test/unit/data/sync_collection.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
+ <d:response>
+ <d:href>/calendars/admin/default/test.ics</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:getetag>"e91f3c9518f76753a7dc5a0cf8998986"</d:getetag>
+ <cal:calendar-data>BEGIN:VCALENDAR
+END:VCALENDAR
+</cal:calendar-data>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+ <d:sync-token>http://sabre.io/ns/sync/3</d:sync-token>
+</d:multistatus>