summaryrefslogtreecommitdiffstats
path: root/js/dav/test
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-19 12:15:47 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-19 14:33:57 +0100
commit9682b588375440922151f87a64f327f6e01fd2b7 (patch)
tree8903b2737fb9d0a367ebe105f595b84015929613 /js/dav/test
parent8121297a9671ce9d236683c4b934b49a709c7797 (diff)
dav.js: adding propfind properties for groups, invites and owner
Diffstat (limited to 'js/dav/test')
-rw-r--r--js/dav/test/unit/data/index.js1
-rw-r--r--js/dav/test/unit/data/propfind_oc.xml37
-rw-r--r--js/dav/test/unit/parser_test.js27
3 files changed, 65 insertions, 0 deletions
diff --git a/js/dav/test/unit/data/index.js b/js/dav/test/unit/data/index.js
index 627a39b6..2394dffc 100644
--- a/js/dav/test/unit/data/index.js
+++ b/js/dav/test/unit/data/index.js
@@ -11,6 +11,7 @@ export default docs;
'current_user_principal',
'calendar_query',
'propfind',
+ 'propfind_oc',
'sync_collection'
].forEach(function(responseType) {
var camelCase = camelize(responseType);
diff --git a/js/dav/test/unit/data/propfind_oc.xml b/js/dav/test/unit/data/propfind_oc.xml
new file mode 100644
index 00000000..f233be04
--- /dev/null
+++ b/js/dav/test/unit/data/propfind_oc.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<d:multistatus xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns/">
+ <d:response>
+ <d:href>/calendars/admin/</d:href>
+ <d:propstat>
+ <d:prop>
+ <d:owner>
+ <d:href>/remote.php/dav/principals/users/admin/</d:href>
+ </d:owner>
+ <oc:groups>
+ <oc:group>Friends</oc:group>
+ <oc:group>Co-Workers</oc:group>
+ </oc:groups>
+ <oc:invite>
+ <oc:user>
+ <d:href>principal:principals/users/user01</d:href>
+ <oc:common-name>user01</oc:common-name>
+ <oc:invite-accepted/>
+ <oc:access>
+
+ <oc:read/>
+ </oc:access>
+ </oc:user>
+ <oc:user>
+ <d:href>principal:principals/users/user02</d:href>
+ <oc:common-name>user02</oc:common-name>
+ <oc:invite-accepted/>
+ <oc:access>
+ <oc:read/>
+ </oc:access>
+ </oc:user>
+ </oc:invite>
+ </d:prop>
+ <d:status>HTTP/1.1 200 OK</d:status>
+ </d:propstat>
+ </d:response>
+</d:multistatus>
diff --git a/js/dav/test/unit/parser_test.js b/js/dav/test/unit/parser_test.js
index bd879d71..bbeeaf52 100644
--- a/js/dav/test/unit/parser_test.js
+++ b/js/dav/test/unit/parser_test.js
@@ -63,4 +63,31 @@ suite('parser.multistatus', function() {
syncToken: 'http://sabre.io/ns/sync/3'
});
});
+
+ test('propfind (oc-groups and oc-invites)', function() {
+ let propfind = data.propfindOc;
+ assert.deepEqual(multistatus(propfind), {
+ response: [{
+ href: '/calendars/admin/',
+ propstat: [{
+ prop: {
+ owner: '/remote.php/dav/principals/users/admin/',
+ invite: [{
+ href: 'principal:principals/users/user01',
+ access: {'read':''},
+ commonName: 'user01',
+ inviteAccepted: ''
+ }, {
+ href: 'principal:principals/users/user02',
+ access: {'read':''},
+ commonName: 'user02',
+ inviteAccepted: ''
+ }],
+ groups: ['Friends', 'Co-Workers']
+ },
+ status: 'HTTP/1.1 200 OK'
+ }]
+ }],
+ });
+ });
});