Skip to content

Commit 61d1d18

Browse files
feat: adapt recommended test 6.2.40
1 parent 62a69aa commit 61d1d18

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

csaf_2_1/recommendedTests/recommendedTest_6_2_40.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ export function containsNoteGroupIdOrProductId(note) {
7676
* @param {any} doc
7777
*/
7878
export function recommendedTest_6_2_40(doc) {
79-
/** @type {Array<{ message: string; instancePath: string }>} */
80-
const warnings = []
81-
const context = { warnings }
79+
/** @type { {warnings: Array<{ message: string; instancePath: string }>;
80+
* infos: Array<{ message: string; instancePath: string }>}} */
81+
const context = {
82+
warnings: [],
83+
infos: [],
84+
}
8285

8386
if (!validate(doc)) {
8487
return context
@@ -92,7 +95,7 @@ export function recommendedTest_6_2_40(doc) {
9295
context.warnings.push({
9396
instancePath: `/document/notes/${noteIndex}`,
9497
message:
95-
'The given note item must include one of the elements "group_id" or "product_id"',
98+
'the given note item must include one of the elements "group_id" or "product_id"',
9699
})
97100
}
98101
}
@@ -106,10 +109,7 @@ export function recommendedTest_6_2_40(doc) {
106109
'product_description'
107110
)
108111
if (!translation) {
109-
//TODO: The warning is just a placeholder. The test should "...be skipped and a output should be shown to the
110-
// user with the text that no translation available...".
111-
// How this output should be implemented has to be clarified
112-
context.warnings.push({
112+
context.infos.push({
113113
instancePath: `/document/notes/${noteIndex}`,
114114
message:
115115
'no language specific translation for the "title" of this note has been recorded',
@@ -121,7 +121,7 @@ export function recommendedTest_6_2_40(doc) {
121121
context.warnings.push({
122122
instancePath: `/document/notes/${noteIndex}`,
123123
message:
124-
'The given note item must include one of the elements "group_id" or "product_id"',
124+
'the given note item must include one of the elements "group_id" or "product_id"',
125125
})
126126
}
127127
}

tests/csaf_2_1/recommendedTest_6_2_40.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ describe('recommendedTest_6_2_40', function () {
2222
1
2323
)
2424
})
25-
// TODO: just a placeholder to get a proper code coverage until to-do in csaf_2_1/recommendedTests/recommendedTest_6_2_40.js is solved
2625
it('no language specific translation', function () {
2726
assert.equal(
2827
recommendedTest_6_2_40({
@@ -37,7 +36,7 @@ describe('recommendedTest_6_2_40', function () {
3736
},
3837
],
3938
},
40-
}).warnings.length,
39+
}).infos.length,
4140
1
4241
)
4342
})

0 commit comments

Comments
 (0)