@@ -16,7 +16,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
1616 describe ( 'Testing USER PUT endpoint with `registry=true`' , ( ) => {
1717 /* Positive Tests */
1818 context ( 'Positive Test' , ( ) => {
19- it ( 'regular user can update their name' , async ( ) => { // --> line 20
19+ it ( 'regular user can update their name' , async ( ) => {
2020 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
2121 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
2222 await chai . request ( app )
@@ -32,7 +32,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
3232 expect ( res . body . updated . name . suffix ) . contain ( 'ddd' )
3333 } )
3434 } )
35- it ( 'regular users can update their secret ' , async ( ) => { // --> line 312
35+ it ( 'regular users can update their secret ' , async ( ) => {
3636 const org = constants . nonSecretariatUserHeaders3 [ 'CVE-API-ORG' ]
3737 const user = constants . nonSecretariatUserHeaders3 [ 'CVE-API-USER' ]
3838 await chai . request ( app )
@@ -48,7 +48,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
4848 } )
4949 /* Negative Tests */
5050 context ( 'Negative Test' , ( ) => {
51- it ( 'regular user cannot update their username' , async ( ) => { // --> line 37
51+ it ( 'regular user cannot update their username' , async ( ) => {
5252 const newUsername = faker . datatype . uuid ( )
5353 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
5454 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
@@ -62,7 +62,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
6262 expect ( res . body . error ) . to . contain ( 'NOT_ORG_ADMIN_OR_SECRETARIAT_UPDATE' )
6363 } )
6464 } )
65- it ( 'regular user cannot update information of another user of the same organization' , async ( ) => { // --> line 45
65+ it ( 'regular user cannot update information of another user of the same organization' , async ( ) => {
6666 const newUsername = faker . datatype . uuid ( )
6767 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
6868 const user2 = constants . nonSecretariatUserHeaders2 [ 'CVE-API-USER' ]
@@ -76,7 +76,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
7676 expect ( res . body . error ) . to . contain ( 'NOT_SAME_USER_OR_SECRETARIAT' )
7777 } )
7878 } )
79- it ( "regular users cannot update a user's username if that user already exist" , async ( ) => { // --> line 62
79+ it ( "regular users cannot update a user's username if that user already exist" , async ( ) => {
8080 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
8181 const user1 = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
8282 const user2 = constants . nonSecretariatUserHeaders2 [ 'CVE-API-USER' ]
@@ -90,7 +90,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
9090 expect ( res . body . error ) . to . contain ( 'NOT_ORG_ADMIN_OR_SECRETARIAT_UPDATE' )
9191 } )
9292 } )
93- it ( 'regular users cannot update organization' , async ( ) => { // --> line 78
93+ it ( 'regular users cannot update organization' , async ( ) => {
9494 const org1 = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
9595 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
9696 const org2 = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
@@ -104,7 +104,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
104104 expect ( res . body . error ) . to . contain ( 'NOT_ALLOWED_TO_CHANGE_ORGANIZATION' )
105105 } )
106106 } )
107- it ( 'regular user cannot change its own active state' , async ( ) => { // --> line 91
107+ it ( 'regular user cannot change its own active state' , async ( ) => {
108108 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
109109 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
110110 await chai . request ( app )
@@ -117,7 +117,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
117117 expect ( res . body . error ) . to . contain ( 'NOT_ORG_ADMIN_OR_SECRETARIAT_UPDATE' )
118118 } )
119119 } )
120- it ( 'regular users cannot add role' , async ( ) => { // --> line 103
120+ it ( 'regular users cannot add role' , async ( ) => {
121121 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
122122 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
123123 await chai . request ( app )
@@ -130,7 +130,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
130130 expect ( res . body . error ) . to . contain ( 'NOT_ORG_ADMIN_OR_SECRETARIAT_UPDATE' )
131131 } )
132132 } )
133- it ( 'regular users cannot remove role' , async ( ) => { // --> line 116
133+ it ( 'regular users cannot remove role' , async ( ) => {
134134 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
135135 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
136136 await chai . request ( app )
@@ -143,7 +143,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
143143 expect ( res . body . error ) . to . contain ( 'NOT_ORG_ADMIN_OR_SECRETARIAT_UPDATE' )
144144 } )
145145 } )
146- it ( "regular user cannot update a user from an org that doesn't exist" , async ( ) => { // --> line 129
146+ it ( "regular user cannot update a user from an org that doesn't exist" , async ( ) => {
147147 const org = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
148148 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
149149 await chai . request ( app )
@@ -156,7 +156,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
156156 expect ( res . body . error ) . to . contain ( 'ORG_DNE_PARAM' )
157157 } )
158158 } )
159- it ( "regular user cannot update a user that doesn't exist " , async ( ) => { // --> line 141
159+ it ( "regular user cannot update a user that doesn't exist " , async ( ) => {
160160 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
161161 const user = faker . datatype . uuid ( )
162162 await chai . request ( app )
@@ -169,7 +169,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
169169 expect ( res . body . error ) . to . contain ( 'USER_DNE' )
170170 } )
171171 } )
172- it ( 'regular user cannot update the secret of another user' , async ( ) => { // --> line 323
172+ it ( 'regular user cannot update the secret of another user' , async ( ) => {
173173 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
174174 const user = constants . nonSecretariatUserHeaders2 [ 'CVE-API-USER' ]
175175 await chai . request ( app )
@@ -182,7 +182,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
182182 expect ( res . body . error ) . to . contain ( 'NOT_SAME_USER_OR_SECRETARIAT' )
183183 } )
184184 } )
185- it ( "regular user cannot reset the secret of a user from an org that doesn't exist" , async ( ) => { // --> line 338
185+ it ( "regular user cannot reset the secret of a user from an org that doesn't exist" , async ( ) => {
186186 const org = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
187187 const user = constants . nonSecretariatUserHeaders [ 'CVE-API-USER' ]
188188 await chai . request ( app )
@@ -195,7 +195,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
195195 expect ( res . body . error ) . to . contain ( 'ORG_DNE_PARAM' )
196196 } )
197197 } )
198- it ( "regular user cannot reset the secret of a user that doesn't exist" , async ( ) => { // --> line 349
198+ it ( "regular user cannot reset the secret of a user that doesn't exist" , async ( ) => {
199199 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
200200 const user = faker . datatype . uuid ( )
201201 await chai . request ( app )
@@ -208,7 +208,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
208208 expect ( res . body . error ) . to . contain ( 'USER_DNE' )
209209 } )
210210 } )
211- it ( "regular user tries resetting admin user's secret, fails and admin user's role remains preserved" , async ( ) => { // --> line 361
211+ it ( "regular user tries resetting admin user's secret, fails and admin user's role remains preserved" , async ( ) => {
212212 const org = constants . nonSecretariatUserHeaders2 [ 'CVE-API-ORG' ]
213213 const user = constants . nonSecretariatUserHeaders2 [ 'CVE-API-USER' ]
214214 await chai . request ( app )
@@ -237,7 +237,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
237237 describe ( 'Testing USER POST endpoint with `registry=true`' , ( ) => {
238238 /* Negative Tests */
239239 context ( 'Negative Test' , ( ) => {
240- it ( 'regular user cannot create another user' , async ( ) => { // --> line 155
240+ it ( 'regular user cannot create another user' , async ( ) => {
241241 const newUsername = faker . datatype . uuid ( )
242242 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
243243 await chai . request ( app )
@@ -257,7 +257,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
257257 describe ( 'Testing USER GET endpoint with `registry=true`' , ( ) => {
258258 /* Positive Tests */
259259 context ( 'Positive Test' , ( ) => {
260- it ( 'regular users can view users of the same organization' , async ( ) => { // --> line 213
260+ it ( 'regular users can view users of the same organization' , async ( ) => {
261261 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
262262 await chai . request ( app )
263263 . get ( `${ ORG_URL } /${ org } /users?registry=true` )
@@ -269,7 +269,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
269269 expect ( res . body . users ) . to . have . lengthOf . above ( 0 )
270270 } )
271271 } )
272- it ( 'regular users can view users of the same organization ' , async ( ) => { // --> line 249
272+ it ( 'regular users can view users of the same organization ' , async ( ) => {
273273 const org = constants . nonSecretariatUserHeaders2 [ 'CVE-API-ORG' ]
274274 const user2 = constants . nonSecretariatUserHeaders2 [ 'CVE-API-USER' ]
275275 await chai . request ( app )
@@ -285,7 +285,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
285285 } )
286286 /* Negative Tests */
287287 context ( 'Negative Test' , ( ) => {
288- it ( "regular users cannot view users of an organization that doesn't exist" , async ( ) => { // --> line 225
288+ it ( "regular users cannot view users of an organization that doesn't exist" , async ( ) => {
289289 const org = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
290290 await chai . request ( app )
291291 . get ( `${ ORG_URL } /${ org } /users?registry=true` )
@@ -297,7 +297,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
297297 expect ( res . body . error ) . to . contain ( 'ORG_DNE_PARAM' )
298298 } )
299299 } )
300- it ( 'regular users cannot view users of another organization' , async ( ) => { // --> line 235
300+ it ( 'regular users cannot view users of another organization' , async ( ) => {
301301 const org = constants . nonSecretariatUserHeaders3 [ 'CVE-API-ORG' ]
302302 await chai . request ( app )
303303 . get ( `${ ORG_URL } /${ org } /users?registry=true` )
@@ -309,7 +309,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
309309 expect ( res . body . error ) . to . contain ( 'NOT_SAME_ORG_OR_SECRETARIAT' )
310310 } )
311311 } )
312- it ( 'regular users cannot view users from another organization' , async ( ) => { // --> line 262
312+ it ( 'regular users cannot view users from another organization' , async ( ) => {
313313 const org = constants . nonSecretariatUserHeaders3 [ 'CVE-API-ORG' ]
314314 const user = constants . nonSecretariatUserHeaders3 [ 'CVE-API-USER' ]
315315 await chai . request ( app )
@@ -322,7 +322,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
322322 expect ( res . body . error ) . to . contain ( 'NOT_SAME_ORG_OR_SECRETARIAT' )
323323 } )
324324 } )
325- it ( "regular user cannot view user that doesn't exist" , async ( ) => { // --> line 273
325+ it ( "regular user cannot view user that doesn't exist" , async ( ) => {
326326 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
327327 const user = faker . datatype . uuid ( )
328328 await chai . request ( app )
@@ -341,7 +341,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
341341 describe ( 'Testing ORG PUT endpoint with `registry=true`' , ( ) => {
342342 /* Negative Tests */
343343 context ( 'Negative Test' , ( ) => {
344- it ( 'regular user cannot update an organization' , async ( ) => { // --> line 167
344+ it ( 'regular user cannot update an organization' , async ( ) => {
345345 const org = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
346346 await chai . request ( app )
347347 . put ( `${ ORG_URL } /${ org } ?registry=true` )
@@ -358,7 +358,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
358358 // Testing ORG POST Endpoints for regular users with `registry=true` flag
359359 describe ( 'Testing ORG POST endpoint with `registry=true`' , ( ) => {
360360 context ( 'Negative Test' , ( ) => {
361- it ( 'regular users cannot create new org' , async ( ) => { // --> line 386
361+ it ( 'regular users cannot create new org' , async ( ) => {
362362 await chai . request ( app )
363363 . post ( `${ ORG_URL } ?registry=true` )
364364 . set ( constants . nonSecretariatUserHeaders )
@@ -375,7 +375,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
375375 describe ( 'Testing ORG GET endpoint with `registry=true`' , ( ) => {
376376 /* Positive Tests */
377377 context ( 'Positive Test' , ( ) => {
378- it ( 'regular users can view the organization they belong to' , async ( ) => { // --> line 180
378+ it ( 'regular users can view the organization they belong to' , async ( ) => {
379379 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
380380 await chai . request ( app )
381381 . get ( `${ ORG_URL } /${ org } ?registry=true` )
@@ -387,7 +387,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
387387 expect ( res . body . short_name ) . to . equal ( org )
388388 } )
389389 } )
390- it ( "regular users can see their organization's cve id quota" , async ( ) => { // --> line 286
390+ it ( "regular users can see their organization's cve id quota" , async ( ) => {
391391 const org = constants . nonSecretariatUserHeaders [ 'CVE-API-ORG' ]
392392 await chai . request ( app )
393393 . get ( `${ ORG_URL } /${ org } /id_quota?registry=true` )
@@ -404,7 +404,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
404404 } )
405405 /* Negative Tests */
406406 context ( 'Negative Test' , ( ) => {
407- it ( "regular users cannot view an organization they don't belong to" , async ( ) => { // --> line 191
407+ it ( "regular users cannot view an organization they don't belong to" , async ( ) => {
408408 const org = faker . datatype . uuid ( ) . slice ( 0 , MAX_SHORTNAME_LENGTH )
409409 await chai . request ( app )
410410 . get ( `${ ORG_URL } /${ org } ?registry=true` )
@@ -416,7 +416,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
416416 expect ( res . body . error ) . to . contain ( 'NOT_SAME_ORG_OR_SECRETARIAT' )
417417 } )
418418 } )
419- it ( 'regular users cannot view all organizations' , async ( ) => { // --> line 202
419+ it ( 'regular users cannot view all organizations' , async ( ) => {
420420 await chai . request ( app )
421421 . get ( `${ ORG_URL } ?registry=true` )
422422 . set ( constants . nonSecretariatUserHeaders )
@@ -427,7 +427,7 @@ describe('Testing regular user permissions for /api/org/ endpoints with `registr
427427 expect ( res . body . error ) . to . contain ( 'SECRETARIAT_ONLY' )
428428 } )
429429 } )
430- it ( "regular users cannot see an organization's cve id quota they don't belong to" , async ( ) => { // --> line 298
430+ it ( "regular users cannot see an organization's cve id quota they don't belong to" , async ( ) => {
431431 const org = constants . nonSecretariatUserHeaders3 [ 'CVE-API-ORG' ]
432432 await chai . request ( app )
433433 . get ( `${ ORG_URL } /${ org } /id_quota?registry=true` )
0 commit comments