-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1063 added unit test to check adpContainer is removed when record is…
… rejected
- Loading branch information
1 parent
bdfb3f2
commit 2b28096
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"cnaContainer": { | ||
"rejectedReasons": [ | ||
{ | ||
"lang": "qe", | ||
"value": "I professional site herself recently behavior. Situation institution meeting recognize successful.", | ||
"supportingMedia": [ | ||
{ | ||
"type": "test/markdown", | ||
"base64": false, | ||
"value": "*this* _is_ supporting media in ~markdown~" | ||
} | ||
] | ||
} | ||
], | ||
"replacedBy": [ | ||
"CVE-1999-0006" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const chai = require('chai') | ||
const expect = chai.expect | ||
const _ = require('lodash') | ||
const cveRecordPublished = require('../../schemas/5.0/CVE-2017-4024_published.json') | ||
const cveRejectExample = require('../../schemas/5.0/rejectCveExample.json') | ||
|
||
const Cve = require('../../../src/model/cve') | ||
const cveCopy = _.cloneDeep(cveRecordPublished) | ||
|
||
describe('Testing rejecting CVE record that has an ADP container', () => { | ||
it('Should return rejected Cve record without ADP container', async () => { | ||
const newRecord = await Cve.updateCveToRejected('', cveRecordPublished.containers.cna.providerMetadata, cveCopy, cveRejectExample) | ||
|
||
expect(newRecord.containers).to.not.have.property('adp') | ||
expect(cveRecordPublished.containers).to.have.property('adp') | ||
expect(newRecord.cveMetadata.state).to.equal('REJECTED') | ||
}) | ||
}) |