@elisra-devops/docgen-data-provider 1.81.0 → 1.83.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 +20 -2
- package/bin/modules/ResultDataProvider.js.map +1 -1
- package/bin/tests/modules/ResultDataProvider.test.js +112 -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 +20 -2
- package/src/tests/modules/ResultDataProvider.test.ts +141 -0
|
@@ -14,7 +14,6 @@ export interface MewpCoverageRequestOptions {
|
|
|
14
14
|
useRelFallback?: boolean;
|
|
15
15
|
externalBugsFile?: MewpExternalFileRef | null;
|
|
16
16
|
externalL3L4File?: MewpExternalFileRef | null;
|
|
17
|
-
mergeDuplicateL2Cells?: boolean;
|
|
18
17
|
}
|
|
19
18
|
export interface MewpInternalValidationRequestOptions {
|
|
20
19
|
useRelFallback?: boolean;
|
|
@@ -580,7 +580,14 @@ class ResultDataProvider {
|
|
|
580
580
|
return !linkedBaseKeys.has(baseKey);
|
|
581
581
|
});
|
|
582
582
|
const missingFamily = [...expectedFamilyCodes].filter((code) => !linkedFullCodes.has(code));
|
|
583
|
-
|
|
583
|
+
// Direction B is family-based: if any member of a family is mentioned in Expected Result,
|
|
584
|
+
// linked members of that same family are not considered "linked but not mentioned".
|
|
585
|
+
const extraLinked = [...linkedFullCodes].filter((code) => {
|
|
586
|
+
const baseKey = this.toRequirementKey(code);
|
|
587
|
+
if (!baseKey)
|
|
588
|
+
return false;
|
|
589
|
+
return !mentionedBaseKeys.has(baseKey);
|
|
590
|
+
});
|
|
584
591
|
const mentionedButNotLinkedByStep = new Map();
|
|
585
592
|
const appendMentionedButNotLinked = (requirementId, stepRef) => {
|
|
586
593
|
const normalizedRequirementId = this.normalizeMewpRequirementCodeWithSuffix(requirementId);
|
|
@@ -783,7 +790,18 @@ class ResultDataProvider {
|
|
|
783
790
|
l4Title: existing.l4Title || l4Title,
|
|
784
791
|
});
|
|
785
792
|
}
|
|
786
|
-
|
|
793
|
+
const normalizedPairs = [...deduped.values()];
|
|
794
|
+
const l3KeysWithAnyL4 = new Set(normalizedPairs
|
|
795
|
+
.filter((item) => !!String((item === null || item === void 0 ? void 0 : item.l3Id) || '').trim() && !!String((item === null || item === void 0 ? void 0 : item.l4Id) || '').trim())
|
|
796
|
+
.map((item) => String((item === null || item === void 0 ? void 0 : item.l3Id) || '').trim().toLowerCase()));
|
|
797
|
+
const filtered = normalizedPairs.filter((item) => {
|
|
798
|
+
const l3Id = String((item === null || item === void 0 ? void 0 : item.l3Id) || '').trim();
|
|
799
|
+
const l4Id = String((item === null || item === void 0 ? void 0 : item.l4Id) || '').trim();
|
|
800
|
+
if (!l3Id || !!l4Id)
|
|
801
|
+
return true;
|
|
802
|
+
return !l3KeysWithAnyL4.has(l3Id.toLowerCase());
|
|
803
|
+
});
|
|
804
|
+
return filtered.sort((a, b) => {
|
|
787
805
|
const l3Compare = String((a === null || a === void 0 ? void 0 : a.l3Id) || '').localeCompare(String((b === null || b === void 0 ? void 0 : b.l3Id) || ''));
|
|
788
806
|
if (l3Compare !== 0)
|
|
789
807
|
return l3Compare;
|