@@ -16,7 +16,6 @@ const should = chai.should();
16
16
describe ( 'Project Member Invite create' , ( ) => {
17
17
let project1 ;
18
18
let project2 ;
19
- let invite1 ;
20
19
beforeEach ( ( done ) => {
21
20
testUtil . clearDb ( )
22
21
. then ( ( ) => {
@@ -184,50 +183,6 @@ describe('Project Member Invite create', () => {
184
183
} ) ;
185
184
} ) ;
186
185
187
- it ( 'should return 400 if user has a pending invite' , ( done ) => {
188
- const mockHttpClient = _ . merge ( testUtil . mockHttpClient , {
189
- get : ( ) => Promise . resolve ( {
190
- status : 200 ,
191
- data : {
192
- id : 'requesterId' ,
193
- version : 'v3' ,
194
- result : {
195
- success : true ,
196
- status : 200 ,
197
- content : [ {
198
- roleName : USER_ROLE . COPILOT ,
199
- } ] ,
200
- } ,
201
- } ,
202
- } ) ,
203
- } ) ;
204
- sandbox . stub ( util , 'getHttpClient' , ( ) => mockHttpClient ) ;
205
- request ( server )
206
- . post ( `/v4/projects/${ project1 . id } /members/invite` )
207
- . set ( {
208
- Authorization : `Bearer ${ testUtil . jwts . copilot } ` ,
209
- } )
210
- . send ( {
211
- param : {
212
- userIds : [ invite1 . userId ] ,
213
- role : 'customer' ,
214
- } ,
215
- } )
216
- . expect ( 'Content-Type' , / j s o n / )
217
- . expect ( 400 )
218
- . end ( ( err , res ) => {
219
- if ( err ) {
220
- done ( err ) ;
221
- } else {
222
- const resJson = res . body . result . content ;
223
- res . body . result . status . should . equal ( 400 ) ;
224
- const errorMessage = _ . get ( resJson , 'message' , '' ) ;
225
- sinon . assert . match ( errorMessage , / .* a l r e a d y i n v i t e d / ) ;
226
- done ( ) ;
227
- }
228
- } ) ;
229
- } ) ;
230
-
231
186
it ( 'should return 403 if try to create copilot with MEMBER' , ( done ) => {
232
187
const mockHttpClient = _ . merge ( testUtil . mockHttpClient , {
233
188
get : ( ) => Promise . resolve ( {
@@ -466,50 +421,6 @@ describe('Project Member Invite create', () => {
466
421
}
467
422
} ) ;
468
423
} ) ;
469
- it ( 'should return 400 if already in the project' , ( done ) => {
470
- const mockHttpClient = _ . merge ( testUtil . mockHttpClient , {
471
- get : ( ) => Promise . resolve ( {
472
- status : 200 ,
473
- data : {
474
- id : 'requesterId' ,
475
- version : 'v3' ,
476
- result : {
477
- success : true ,
478
- status : 200 ,
479
- content : [ {
480
- roleName : USER_ROLE . MANAGER ,
481
- } ] ,
482
- } ,
483
- } ,
484
- } ) ,
485
- } ) ;
486
- sandbox . stub ( util , 'getHttpClient' , ( ) => mockHttpClient ) ;
487
- request ( server )
488
- . post ( `/v4/projects/${ project1 . id } /members/invite` )
489
- . set ( {
490
- Authorization : `Bearer ${ testUtil . jwts . manager } ` ,
491
- } )
492
- . send ( {
493
- param : {
494
- userIds : [ 40051332 ] ,
495
- role : 'manager' ,
496
- } ,
497
- } )
498
- . expect ( 'Content-Type' , / j s o n / )
499
- . expect ( 400 )
500
- . end ( ( err , res ) => {
501
- if ( err ) {
502
- done ( err ) ;
503
- } else {
504
- const resJson = res . body . result . content ;
505
- should . exist ( resJson ) ;
506
- res . body . result . status . should . equal ( 400 ) ;
507
- const errorMessage = _ . get ( resJson , 'message' , '' ) ;
508
- sinon . assert . match ( errorMessage , / .* a r e a l r e a d y m e m b e r s o f p r o j e c t / ) ;
509
- done ( ) ;
510
- }
511
- } ) ;
512
- } ) ;
513
424
514
425
describe ( 'Bus api' , ( ) => {
515
426
let createEventSpy ;
0 commit comments