@elisra-devops/docgen-data-provider 1.81.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/models/mewp-reporting.d.ts +0 -1
- package/bin/modules/ResultDataProvider.js +12 -1
- package/bin/modules/ResultDataProvider.js.map +1 -1
- package/bin/tests/modules/ResultDataProvider.test.js +60 -0
- package/bin/tests/modules/ResultDataProvider.test.js.map +1 -1
- package/package.json +1 -1
- package/src/models/mewp-reporting.ts +0 -1
- package/src/modules/ResultDataProvider.ts +13 -1
- package/src/tests/modules/ResultDataProvider.test.ts +78 -0
|
@@ -1146,6 +1146,66 @@ describe('ResultDataProvider', () => {
|
|
|
1146
1146
|
'L4 REQ ID': '',
|
|
1147
1147
|
}));
|
|
1148
1148
|
});
|
|
1149
|
+
it('should drop standalone L3 row when same L3 has one or more L4 links', () => {
|
|
1150
|
+
const requirements = [
|
|
1151
|
+
{
|
|
1152
|
+
requirementId: 'SR5310',
|
|
1153
|
+
baseKey: 'SR5310',
|
|
1154
|
+
title: 'Req 5310',
|
|
1155
|
+
subSystem: 'Power',
|
|
1156
|
+
responsibility: 'ESUK',
|
|
1157
|
+
linkedTestCaseIds: [111],
|
|
1158
|
+
},
|
|
1159
|
+
];
|
|
1160
|
+
const requirementIndex = new Map([
|
|
1161
|
+
[
|
|
1162
|
+
'SR5310',
|
|
1163
|
+
new Map([
|
|
1164
|
+
[
|
|
1165
|
+
111,
|
|
1166
|
+
{
|
|
1167
|
+
passed: 1,
|
|
1168
|
+
failed: 0,
|
|
1169
|
+
notRun: 0,
|
|
1170
|
+
},
|
|
1171
|
+
],
|
|
1172
|
+
]),
|
|
1173
|
+
],
|
|
1174
|
+
]);
|
|
1175
|
+
const observedTestCaseIdsByRequirement = new Map([
|
|
1176
|
+
['SR5310', new Set([111])],
|
|
1177
|
+
]);
|
|
1178
|
+
const linkedRequirementsByTestCase = new Map([
|
|
1179
|
+
[
|
|
1180
|
+
111,
|
|
1181
|
+
{
|
|
1182
|
+
baseKeys: new Set(['SR5310']),
|
|
1183
|
+
fullCodes: new Set(['SR5310']),
|
|
1184
|
+
bugIds: new Set(),
|
|
1185
|
+
},
|
|
1186
|
+
],
|
|
1187
|
+
]);
|
|
1188
|
+
const l3l4ByBaseKey = new Map([
|
|
1189
|
+
[
|
|
1190
|
+
'SR5310',
|
|
1191
|
+
[
|
|
1192
|
+
{ l3Id: '9003', l3Title: 'L3 9003', l4Id: '', l4Title: '' },
|
|
1193
|
+
{ l3Id: '9003', l3Title: 'L3 9003', l4Id: '9103', l4Title: 'L4 9103' },
|
|
1194
|
+
{ l3Id: '9003', l3Title: 'L3 9003', l4Id: '9104', l4Title: 'L4 9104' },
|
|
1195
|
+
],
|
|
1196
|
+
],
|
|
1197
|
+
]);
|
|
1198
|
+
const rows = resultDataProvider.buildMewpCoverageRows(requirements, requirementIndex, observedTestCaseIdsByRequirement, linkedRequirementsByTestCase, l3l4ByBaseKey, new Map());
|
|
1199
|
+
expect(rows).toHaveLength(2);
|
|
1200
|
+
expect(rows[0]).toEqual(expect.objectContaining({
|
|
1201
|
+
'L3 REQ ID': '9003',
|
|
1202
|
+
'L4 REQ ID': '9103',
|
|
1203
|
+
}));
|
|
1204
|
+
expect(rows[1]).toEqual(expect.objectContaining({
|
|
1205
|
+
'L3 REQ ID': '9003',
|
|
1206
|
+
'L4 REQ ID': '9104',
|
|
1207
|
+
}));
|
|
1208
|
+
});
|
|
1149
1209
|
it('should not emit bug rows from ADO-linked bug ids when external bugs source is empty', () => {
|
|
1150
1210
|
const requirements = [
|
|
1151
1211
|
{
|