Skip to content

Commit 6cac00d

Browse files
feat: change inputSchema test from valid to failing example
1 parent 9e49162 commit 6cac00d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/csaf_2_1/mandatoryTest_6_1_46.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@ import assert from 'node:assert/strict'
22
import { mandatoryTest_6_1_46 } from '../../csaf_2_1/mandatoryTests/mandatoryTest_6_1_46.js'
33
import { expect } from 'chai'
44

5-
const validInputSchemaTestWithEmptyVulnerability6_1_46 = {
5+
const failingInputSchemaTestWithEmptyVulnerability6_1_46 = {
66
vulnerabilities: [
77
{}, // even this vulnerability is empty, the test should not fail due to the inputSchema
88
{
9+
cve: 'CVE-1900-0001',
910
metrics: [
1011
{
1112
content: {
1213
ssvc_v1: {
1314
id: 'CVE-1900-0001',
1415
schemaVersion: '1-0-1',
15-
selections: [
16-
{
17-
name: 'Mission Impact',
18-
namespace: 'ssvc',
19-
values: ['None'],
20-
version: '1.0.0',
21-
},
22-
],
2316
timestamp: '2024-01-24T10:00:00.000Z',
2417
},
2518
},
@@ -36,8 +29,8 @@ describe('mandatoryTest_6_1_46', function () {
3629
})
3730
it('test input schema with empty json object in vulnerabilities', async function () {
3831
const result = mandatoryTest_6_1_46(
39-
validInputSchemaTestWithEmptyVulnerability6_1_46
32+
failingInputSchemaTestWithEmptyVulnerability6_1_46
4033
)
41-
expect(result.errors.length).to.eq(0)
34+
expect(result.errors.length).to.eq(1)
4235
})
4336
})

0 commit comments

Comments
 (0)