Skip to content

Commit d3df80d

Browse files
authored
Merge pull request #1691 from CVEProject/dr_1683
#1683 hard_quota is now a Joint Approval
2 parents 2051c06 + 25c922f commit d3df80d

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/constants/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function getConstants () {
4444
USER_ROLES: [
4545
'ADMIN'
4646
],
47-
JOINT_APPROVAL_FIELDS: ['short_name', 'long_name', 'authority', 'aliases', 'oversees', 'root_or_tlr', 'charter_or', 'product_list', 'disclosure_policy', 'contact_info.poc', 'contact_info.poc_email', 'contact_info.poc_phone', 'contact_info.org_email', 'cna_role_type', 'cna_country', 'vulnerability_advisory_locations', 'advisory_location_require_credentials', 'industry', 'tl_root_start_date', 'is_cna_discussion_list'],
48-
JOINT_APPROVAL_FIELDS_LEGACY: ['short_name', 'name', 'authority.active_roles'],
47+
JOINT_APPROVAL_FIELDS: ['short_name', 'long_name', 'authority', 'aliases', 'oversees', 'root_or_tlr', 'charter_or', 'product_list', 'disclosure_policy', 'contact_info.poc', 'contact_info.poc_email', 'contact_info.poc_phone', 'contact_info.org_email', 'cna_role_type', 'cna_country', 'vulnerability_advisory_locations', 'advisory_location_require_credentials', 'industry', 'tl_root_start_date', 'is_cna_discussion_list', 'hard_quota'],
48+
JOINT_APPROVAL_FIELDS_LEGACY: ['short_name', 'name', 'authority.active_roles', 'policies.id_quota'],
4949
USER_ROLE_ENUM: {
5050
ADMIN: 'ADMIN'
5151
},

test/integration-tests/registry-org/registryOrgWithJointReviewTest.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('Testing Joint approval', () => {
116116
await chai.request(app)
117117
.put('/api/registry/org/non_secretariat_org')
118118
.set(nonAdminHeaders)
119-
.send({ ...testRegistryOrgForReview, short_name: 'new_non_secretariat_org', hard_quota: 10000 })
119+
.send({ ...testRegistryOrgForReview, short_name: 'new_non_secretariat_org', contact_info: { website: 'https://www.example.com' } })
120120
.then((res) => {
121121
expect(res).to.have.status(200)
122122
expect(res.body.message).to.contain('organization was successfully updated, but joint approval is required for some fields.')
@@ -144,11 +144,11 @@ describe('Testing Joint approval', () => {
144144
expect(err).to.be.undefined
145145
expect(res).to.have.status(200)
146146
expect(res.body.short_name).to.equal('non_secretariat_org')
147-
expect(res.body.hard_quota).to.equal(10000)
147+
expect(res.body.contact_info.website).to.equal('https://www.example.com')
148148
})
149149
})
150150
it('Secretariat can approve the ORG review with body parameter', async function () {
151-
const newBody = { short_name: 'final_non_secretariat_org', authority: ['SECRETARIAT'], hard_quota: 20000, long_name: 'Final Non Secretariat Organization' }
151+
const newBody = { short_name: 'final_non_secretariat_org', contact_info: { website: 'https://final.example.com' }, hard_quota: 1000, authority: ['CNA'], long_name: 'Final Non Secretariat Organization' }
152152
await chai.request(app)
153153
.put(`/api/review/${reviewUUID}/approve`)
154154
.set(secretariatHeaders)
@@ -164,7 +164,7 @@ describe('Testing Joint approval', () => {
164164
expect(err).to.be.undefined
165165
expect(res).to.have.status(200)
166166
expect(res.body.short_name).to.equal('final_non_secretariat_org')
167-
expect(res.body.hard_quota).to.equal(20000)
167+
expect(res.body.contact_info.website).to.equal('https://final.example.com')
168168
})
169169
})
170170
})
@@ -219,7 +219,7 @@ describe('Testing Joint approval', () => {
219219
await chai.request(app)
220220
.put('/api/registry/org/non_with_comments')
221221
.set(nonAdminHeaders2)
222-
.send({ ...testRegistryOrgForReviewWithComments, short_name: 'new_non_with_comments', hard_quota: 10000 })
222+
.send({ ...testRegistryOrgForReviewWithComments, short_name: 'new_non_with_comments', contact_info: { website: 'https://www.example.com' } })
223223
.then((res) => {
224224
expect(res).to.have.status(200)
225225
expect(res.body.message).to.contain('organization was successfully updated, but joint approval is required for some fields.')
@@ -247,7 +247,7 @@ describe('Testing Joint approval', () => {
247247
expect(err).to.be.undefined
248248
expect(res).to.have.status(200)
249249
expect(res.body.short_name).to.equal('non_with_comments')
250-
expect(res.body.hard_quota).to.equal(10000)
250+
expect(res.body.contact_info.website).to.equal('https://www.example.com')
251251
})
252252
})
253253
it('Secretariat leaves a public comment on the org review', async () => {
@@ -320,7 +320,7 @@ describe('Testing Joint approval', () => {
320320
expect(err).to.be.undefined
321321
expect(res).to.have.status(200)
322322
expect(res.body.short_name).to.equal('new_non_with_comments')
323-
expect(res.body.hard_quota).to.equal(10000)
323+
expect(res.body.hard_quota).to.equal(1000)
324324
})
325325
})
326326
})

test/integration-tests/review-object/reviewObjectTest.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,16 @@ describe('Review Object Controller Integration Tests', () => {
187187
const updateData = {}
188188
updateData.short_name = constants.existingOrg.short_name
189189
updateData.long_name = 'Approve Test Organization'
190-
updateData.hard_quota = 123
191190
updateData.authority = ['CNA']
191+
updateData.hard_quota = 1000
192+
updateData.contact_info = { website: 'https://www.example.com' }
192193
const res = await chai
193194
.request(app)
194195
.put(`/api/registry/org/${constants.existingOrg.short_name}`)
195196
.set({ ...constants.nonSecretariatUserHeaders2 })
196197
.send(updateData)
197198
expect(res).to.have.status(200)
198-
expect(res.body.updated.hard_quota).to.equal(123)
199+
expect(res.body.updated.contact_info.website).to.equal('https://www.example.com')
199200

200201
const reviewRes = await chai
201202
.request(app)
@@ -205,7 +206,7 @@ describe('Review Object Controller Integration Tests', () => {
205206
expect(reviewRes.body).to.have.property('uuid')
206207
expect(reviewRes.body.status).to.equal('pending')
207208
expect(reviewRes.body).to.have.nested.property('new_review_data.long_name', 'Approve Test Organization')
208-
expect(reviewRes.body).to.have.nested.property('new_review_data.hard_quota', 123)
209+
expect(reviewRes.body).to.have.nested.property('new_review_data.contact_info.website', 'https://www.example.com')
209210
approveTestReviewUUID = reviewRes.body.uuid
210211
})
211212

0 commit comments

Comments
 (0)