@@ -18,6 +18,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
1818 isUser : false ,
1919 isGroup : false ,
2020 isCircle : false ,
21+ isRemoteUser : false ,
2122 uri : null ,
2223 } )
2324 } )
@@ -33,6 +34,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
3334 isUser : false ,
3435 isGroup : false ,
3536 isCircle : false ,
37+ isRemoteUser : false ,
3638 uri : null ,
3739 otherProp : 'foo' ,
3840 } )
@@ -55,6 +57,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
5557 isUser : true ,
5658 isGroup : false ,
5759 isCircle : false ,
60+ isRemoteUser : false ,
5861 uri : 'principal:principals/users/user4' ,
5962 } )
6063 } )
@@ -76,6 +79,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
7679 isUser : true ,
7780 isGroup : false ,
7881 isCircle : false ,
82+ isRemoteUser : false ,
7983 uri : 'principal:principals/users/user4' ,
8084 } )
8185 } )
@@ -97,6 +101,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
97101 isUser : false ,
98102 isGroup : true ,
99103 isCircle : false ,
104+ isRemoteUser : false ,
100105 uri : 'principal:principals/groups/admin' ,
101106 } )
102107 } )
@@ -118,6 +123,7 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
118123 isUser : false ,
119124 isGroup : false ,
120125 isCircle : true ,
126+ isRemoteUser : false ,
121127 uri : 'principal:principals/circles/c479c14bd82415' ,
122128 } )
123129 } )
@@ -141,10 +147,57 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
141147 isUser : false ,
142148 isGroup : false ,
143149 isCircle : true ,
150+ isRemoteUser : false ,
144151 uri : 'principal:principals/circles/c479c14bd82415' ,
145152 } )
146153 } )
147154
155+ it ( 'should map a dav sharee to a calendar share object - remote user' , ( ) => {
156+ const davSharee = {
157+ // Decoded cloud id: marcus@federated .cloud.com
158+ 'href' : 'principal:principals/remote-users/bWFyY3VzQGZlZGVyYXRlZC5jbG91ZC5jb20=' ,
159+ 'common-name' : 'Marcus Beehler@federated.cloud.com' ,
160+ 'invite-accepted' : true ,
161+ 'access' : [
162+ '{http://owncloud.org/ns}read'
163+ ]
164+ }
165+
166+ expect ( mapDavShareeToCalendarShareObject ( davSharee ) ) . toEqual ( {
167+ id : 'cHJpbmNpcGFsOnByaW5jaXBhbHMvcmVtb3RlLXVzZXJzL2JXRnlZM1Z6UUdabFpHVnlZWFJsWkM1amJHOTFaQzVqYjIwPQ==' ,
168+ displayName : 'Marcus Beehler@federated.cloud.com' ,
169+ writeable : false ,
170+ isUser : false ,
171+ isGroup : false ,
172+ isCircle : false ,
173+ isRemoteUser : true ,
174+ uri : 'principal:principals/remote-users/bWFyY3VzQGZlZGVyYXRlZC5jbG91ZC5jb20=' ,
175+ } )
176+ } )
177+
178+ it ( 'should map a dav sharee to a calendar share object - remote user without displayname' , ( ) => {
179+ const davSharee = {
180+ // Decoded cloud id: marcus@federated .cloud.com
181+ 'href' : 'principal:principals/remote-users/bWFyY3VzQGZlZGVyYXRlZC5jbG91ZC5jb20=' ,
182+ 'common-name' : '' ,
183+ 'invite-accepted' : true ,
184+ 'access' : [
185+ '{http://owncloud.org/ns}read'
186+ ]
187+ }
188+
189+ expect ( mapDavShareeToCalendarShareObject ( davSharee ) ) . toEqual ( {
190+ id : 'cHJpbmNpcGFsOnByaW5jaXBhbHMvcmVtb3RlLXVzZXJzL2JXRnlZM1Z6UUdabFpHVnlZWFJsWkM1amJHOTFaQzVqYjIwPQ==' ,
191+ displayName : 'marcus@federated.cloud.com' ,
192+ writeable : false ,
193+ isUser : false ,
194+ isGroup : false ,
195+ isCircle : false ,
196+ isRemoteUser : true ,
197+ uri : 'principal:principals/remote-users/bWFyY3VzQGZlZGVyYXRlZC5jbG91ZC5jb20=' ,
198+ } )
199+ } )
200+
148201 it ( 'should properly handle sharee URIs with non-ascii characters' , ( ) => {
149202 const davSharee = {
150203 'href' : 'principal:principals/groups/מַזָּל טוֹב' ,
@@ -162,8 +215,8 @@ describe('Test suite: Calendar share model (models/calendarShare.js)', () => {
162215 isUser : false ,
163216 isGroup : true ,
164217 isCircle : false ,
218+ isRemoteUser : false ,
165219 uri : 'principal:principals/groups/מַזָּל טוֹב' ,
166220 } )
167221 } )
168-
169222} )
0 commit comments