File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1
1
import assert from 'node:assert/strict'
2
2
import { mandatoryTest_6_1_46 } from '../../csaf_2_1/mandatoryTests/mandatoryTest_6_1_46.js'
3
+ import { expect } from 'chai'
4
+
5
+ const validInputSchemaTestWithEmptyVulnerability6_1_46 = {
6
+ vulnerabilities : [
7
+ { } , // even this vulnerability is empty, the test should not fail due to the inputSchema
8
+ {
9
+ metrics : [
10
+ {
11
+ content : {
12
+ ssvc_v1 : {
13
+ id : 'CVE-1900-0001' ,
14
+ schemaVersion : '1-0-1' ,
15
+ selections : [
16
+ {
17
+ name : 'Mission Impact' ,
18
+ namespace : 'ssvc' ,
19
+ values : [ 'None' ] ,
20
+ version : '1.0.0' ,
21
+ } ,
22
+ ] ,
23
+ timestamp : '2024-01-24T10:00:00.000Z' ,
24
+ } ,
25
+ } ,
26
+ products : [ 'CSAFPID-9080700' ] ,
27
+ } ,
28
+ ] ,
29
+ } ,
30
+ ] ,
31
+ }
3
32
4
33
describe ( 'mandatoryTest_6_1_46' , function ( ) {
5
34
it ( 'only runs on relevant documents' , function ( ) {
6
35
assert . equal ( mandatoryTest_6_1_46 ( { document : 'mydoc' } ) . isValid , true )
7
36
} )
37
+ it ( 'test input schema with empty json object in vulnerabilities' , async function ( ) {
38
+ const result = mandatoryTest_6_1_46 (
39
+ validInputSchemaTestWithEmptyVulnerability6_1_46
40
+ )
41
+ expect ( result . errors . length ) . to . eq ( 0 )
42
+ } )
8
43
} )
You can’t perform that action at this time.
0 commit comments