Skip to content

Commit 4857451

Browse files
Merge pull request #4786 from linuxfoundation/unicron-4762-cypress-apis-test-coverage-7
Update test coverage for cla-manager APIs group + fix some missing required flags in swagger
2 parents 07b0a75 + 1beb526 commit 4857451

File tree

7 files changed

+810
-90
lines changed

7 files changed

+810
-90
lines changed

cla-backend-go/swagger/cla.v2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,7 @@ paths:
26642664
- $ref: "#/parameters/path-userID"
26652665
- name: body
26662666
in: body
2667+
required: true
26672668
schema:
26682669
type: object
26692670
required:
@@ -2830,6 +2831,7 @@ paths:
28302831
- $ref: "#/parameters/path-companyID"
28312832
- $ref: "#/parameters/path-projectSFID"
28322833
- name: body
2834+
required: true
28332835
in: body
28342836
schema:
28352837
type: object
@@ -2999,6 +3001,7 @@ paths:
29993001
- $ref: "#/parameters/path-companyID"
30003002
- name: body
30013003
in: body
3004+
required: true
30023005
schema:
30033006
type: object
30043007
x-nullable: false
@@ -3044,6 +3047,7 @@ paths:
30443047
- $ref: "#/parameters/path-companyID"
30453048
- name: body
30463049
in: body
3050+
required: true
30473051
schema:
30483052
type: object
30493053
x-nullable: false

tests/functional/cypress/e2e/cla-group.cy.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
validate_403_Status,
77
validate_404_Status,
88
validate_404_Status_and_Message,
9-
validate_404_Status_and_Message2,
109
validate_405_Status_and_Message,
1110
validate_422_Status,
1211
getTokenKey,
@@ -184,7 +183,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
184183
method: 'GET',
185184
url: `${claEndpoint}foundation//cla-groups`,
186185
expectedStatus: 404,
187-
expectedCode: 1,
186+
expectedCode: 404,
188187
expectedMsg: 'path /v4/foundation//cla-groups was not found',
189188
mode: 'local',
190189
},
@@ -266,7 +265,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
266265
method: 'PUT',
267266
url: `${claEndpoint}cla-group/${exampleClaGroupId}/enroll-projects`,
268267
expectedStatus: 404,
269-
expectedCode: 2,
268+
expectedCode: 404,
270269
expectedMsg: `EasyCLA - 404 Not Found - problem loading CLA Group by ID: ${exampleClaGroupId} - error: cla group ${exampleClaGroupId} not found`,
271270
mode: 'both',
272271
},
@@ -298,7 +297,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
298297
method: 'PUT',
299298
url: `${claEndpoint}cla-group/${exampleClaGroupId}/unenroll-projects`,
300299
expectedStatus: 404,
301-
expectedCode: 2,
300+
expectedCode: 404,
302301
expectedMsg: `EasyCLA - 404 Not Found - unable to locate CLA Group by ID: ${exampleClaGroupId} - error: cla group ${exampleClaGroupId} not found`,
303302
mode: 'both',
304303
},
@@ -319,7 +318,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
319318
method: 'GET',
320319
url: `${claEndpoint}project//github/organizations`,
321320
expectedStatus: 404,
322-
expectedCode: 1,
321+
expectedCode: 404,
323322
expectedMsg: 'path /v4/project//github/organizations was not found',
324323
mode: 'local',
325324
},
@@ -339,7 +338,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
339338
method: 'GET',
340339
url: `${claEndpoint}project/aaaa/github/organizations`,
341340
expectedStatus: 404,
342-
expectedCode: 2,
341+
expectedCode: 404,
343342
expectedMsg: 'EasyCLA - 404 Not Found - github organization with project SFID not found: aaaa',
344343
mode: 'both',
345344
},
@@ -349,7 +348,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
349348
method: 'PUT',
350349
url: `${claEndpoint}project//github/organizations//config`,
351350
expectedStatus: 404,
352-
expectedCode: 1,
351+
expectedCode: 404,
353352
expectedMsg: 'path /v4/project//github/organizations//config was not found',
354353
mode: 'local',
355354
},
@@ -369,7 +368,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
369368
method: 'PUT',
370369
url: `${claEndpoint}project//github/organizations/org/config`,
371370
expectedStatus: 404,
372-
expectedCode: 1,
371+
expectedCode: 404,
373372
expectedMsg: 'path /v4/project//github/organizations/org/config was not found',
374373
mode: 'local',
375374
},
@@ -450,7 +449,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
450449
method: 'DELETE',
451450
url: `${claEndpoint}cla-group/${exampleClaGroupId}`,
452451
expectedStatus: 404,
453-
expectedCode: 2,
452+
expectedCode: 404,
454453
expectedMsg: `EasyCLA - 404 Not Found - cla group ${exampleClaGroupId} not found`,
455454
mode: 'both',
456455
},
@@ -479,11 +478,7 @@ describe("To Validate 'GET, CREATE, UPDATE and DELETE' CLA groups API call on ch
479478
case 403:
480479
return validate_403_Status(response);
481480
case 404:
482-
if (expectedCode === 1) {
483-
return validate_404_Status_and_Message(response, expectedMsg);
484-
} else {
485-
return validate_404_Status_and_Message2(response, expectedMsg);
486-
}
481+
return validate_404_Status_and_Message(response, expectedMsg);
487482
case 405:
488483
return validate_405_Status_and_Message(response, expectedMsg);
489484
case 422:

0 commit comments

Comments
 (0)