File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,7 @@ describe('GET Project', () => {
526
526
} ) ;
527
527
} ) ;
528
528
529
- it ( 'should not return "email " for any invite which has userId field' , ( done ) => {
529
+ it ( 'should not return "userId " for any invite which has "email" field' , ( done ) => {
530
530
request ( server )
531
531
. get ( `/v5/projects/${ project1 . id } ` )
532
532
. set ( {
@@ -541,8 +541,8 @@ describe('GET Project', () => {
541
541
const resJson = res . body ;
542
542
should . exist ( resJson ) ;
543
543
resJson . invites . length . should . be . eql ( 1 ) ;
544
- resJson . invites [ 0 ] . should . have . property ( 'userId ' ) ;
545
- should . not . exist ( resJson . invites [ 0 ] . email ) ;
544
+ resJson . invites [ 0 ] . should . have . property ( 'email ' ) ;
545
+ should . not . exist ( resJson . invites [ 0 ] . userId ) ;
546
546
done ( ) ;
547
547
}
548
548
} ) ;
Original file line number Diff line number Diff line change @@ -382,10 +382,6 @@ describe('LIST Project', () => {
382
382
const resJson = res . body ;
383
383
should . exist ( resJson ) ;
384
384
resJson . should . have . lengthOf ( 2 ) ;
385
- resJson [ 0 ] . invites [ 0 ] . should . have . property ( 'userId' ) ;
386
- should . not . exist ( resJson [ 0 ] . invites [ 0 ] . email ) ;
387
- resJson [ 1 ] . invites [ 0 ] . should . have . property ( 'userId' ) ;
388
- should . not . exist ( resJson [ 1 ] . invites [ 0 ] . email ) ;
389
385
done ( ) ;
390
386
}
391
387
} ) ;
@@ -1081,8 +1077,8 @@ describe('LIST Project', () => {
1081
1077
resJson . should . have . lengthOf ( 1 ) ;
1082
1078
resJson [ 0 ] . name . should . equal ( 'test1' ) ;
1083
1079
resJson [ 0 ] . invites . should . have . lengthOf ( 2 ) ;
1084
- resJson [ 0 ] . invites [ 0 ] . should . have . property ( 'userId ' ) ;
1085
- should . not . exist ( resJson [ 0 ] . invites [ 0 ] . email ) ;
1080
+ resJson [ 0 ] . invites [ 0 ] . should . have . property ( 'email ' ) ;
1081
+ should . not . exist ( resJson [ 0 ] . invites [ 0 ] . userId ) ;
1086
1082
resJson [ 0 ] . invites [ 1 ] . email . should . equal ( 'h***o@w***d.com' ) ;
1087
1083
done ( ) ;
1088
1084
}
Original file line number Diff line number Diff line change @@ -190,22 +190,24 @@ describe('Util method', () => {
190
190
util . postProcessInvites ( '$.invites[?(@.email)]' , detail , res ) . should . deep . equal ( detail2 ) ;
191
191
} ) ;
192
192
193
- it ( 'should not return emails for invite with defined userId ' , ( ) => {
193
+ it ( 'should not return `userId` for invite by email ' , ( ) => {
194
194
const detail = {
195
195
id : 1 ,
196
196
invites : [ {
197
197
id : 2 ,
198
198
email : 'abcd@aaaa.com' ,
199
199
userId : 33 ,
200
+ createdBy : 2 ,
200
201
} ,
201
202
] ,
202
203
} ;
203
204
const detail2 = {
204
205
id : 1 ,
205
206
invites : [ {
206
207
id : 2 ,
207
- email : null ,
208
- userId : 33 ,
208
+ email : 'abcd@aaaa.com' ,
209
+ userId : null ,
210
+ createdBy : 2 ,
209
211
} ,
210
212
] ,
211
213
} ;
You can’t perform that action at this time.
0 commit comments