@@ -213,54 +213,6 @@ describe('Testing Edit user endpoint', () => {
213213 expect ( res . body . updated . status ) . to . equal ( 'active' )
214214 } )
215215 } )
216- it ( 'Should update org affiliations with registry enabled' , async ( ) => {
217- const user = await createRegistryUserForUpdateTest ( 'range_4' )
218- let affiliatedOrg
219- await chai . request ( app )
220- . get ( '/api/registry/org/win_5' )
221- . set ( constants . headers )
222- . then ( ( res ) => {
223- expect ( res ) . to . have . status ( 200 )
224- affiliatedOrg = res . body
225- } )
226-
227- await chai . request ( app )
228- . put ( `/api/registry/org/range_4/user/${ user . username } ` )
229- . set ( constants . headers )
230- . send ( {
231- ...user ,
232- org_affiliations : [ affiliatedOrg . UUID ]
233- } )
234- . then ( ( res , err ) => {
235- expect ( err ) . to . be . undefined
236- expect ( res ) . to . have . status ( 200 )
237- expect ( res . body . updated . org_affiliations ) . to . deep . equal ( [ affiliatedOrg . UUID ] )
238- } )
239- } )
240- it ( 'Should update CVE program org membership with registry enabled' , async ( ) => {
241- const user = await createRegistryUserForUpdateTest ( 'range_4' )
242- let memberOrg
243- await chai . request ( app )
244- . get ( '/api/registry/org/range_4' )
245- . set ( constants . headers )
246- . then ( ( res ) => {
247- expect ( res ) . to . have . status ( 200 )
248- memberOrg = res . body
249- } )
250-
251- await chai . request ( app )
252- . put ( `/api/registry/org/range_4/user/${ user . username } ` )
253- . set ( constants . headers )
254- . send ( {
255- ...user ,
256- cve_program_org_membership : [ memberOrg . UUID ]
257- } )
258- . then ( ( res , err ) => {
259- expect ( err ) . to . be . undefined
260- expect ( res ) . to . have . status ( 200 )
261- expect ( res . body . updated . cve_program_org_membership ) . to . deep . equal ( [ memberOrg . UUID ] )
262- } )
263- } )
264216 } )
265217 context ( 'Negative Tests' , ( ) => {
266218 it ( 'Should return an error when admin is required' , async ( ) => {
@@ -289,38 +241,6 @@ describe('Testing Edit user endpoint', () => {
289241 expect ( res . body . error ) . to . contain ( 'NOT_ALLOWED_TO_CHANGE_FIELD' )
290242 } )
291243 } )
292- it ( 'Should return an error when a regular user attempts to update org affiliations with registry enabled' , async ( ) => {
293- let user
294- await chai . request ( app ) . get ( '/api/registry/org/win_5/user/jasminesmith@win_5.com' ) . set ( constants . nonSecretariatUserHeaders ) . then ( ( res ) => { user = res . body } )
295- await chai . request ( app )
296- . put ( '/api/registry/org/win_5/user/jasminesmith@win_5.com' )
297- . set ( constants . nonSecretariatUserHeaders )
298- . send ( {
299- ...user ,
300- org_affiliations : [ 'd41d8cd9-8f00-3204-a980-0998ecf8427e' ]
301- } )
302- . then ( ( res , err ) => {
303- expect ( err ) . to . be . undefined
304- expect ( res ) . to . have . status ( 400 )
305- expect ( res . body . error ) . to . contain ( 'NOT_ALLOWED_TO_CHANGE_FIELD' )
306- } )
307- } )
308- it ( 'Should return an error when a regular user attempts to update CVE program org membership with registry enabled' , async ( ) => {
309- let user
310- await chai . request ( app ) . get ( '/api/registry/org/win_5/user/jasminesmith@win_5.com' ) . set ( constants . nonSecretariatUserHeaders ) . then ( ( res ) => { user = res . body } )
311- await chai . request ( app )
312- . put ( '/api/registry/org/win_5/user/jasminesmith@win_5.com' )
313- . set ( constants . nonSecretariatUserHeaders )
314- . send ( {
315- ...user ,
316- cve_program_org_membership : [ '7f593536-7cbc-46fd-bdd9-b6176c9cd93f' ]
317- } )
318- . then ( ( res , err ) => {
319- expect ( err ) . to . be . undefined
320- expect ( res ) . to . have . status ( 400 )
321- expect ( res . body . error ) . to . contain ( 'NOT_ALLOWED_TO_CHANGE_FIELD' )
322- } )
323- } )
324244 it ( 'Should not allow a first name of more than 100 characters' , async ( ) => {
325245 await chai . request ( app )
326246 . put ( '/api/org/win_5/user/jasminesmith@win_5.com?name.first=1:1234567,2:1234567,3:1234567,4:1234567,5:1234567,6:1234567,7:1234567,8:1234567,9:1234567,10:1234567,11:1234567' )
0 commit comments