@elisra-devops/docgen-data-provider 1.82.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/modules/ResultDataProvider.js +8 -1
- package/bin/modules/ResultDataProvider.js.map +1 -1
- package/bin/tests/modules/ResultDataProvider.test.js +52 -0
- package/bin/tests/modules/ResultDataProvider.test.js.map +1 -1
- package/package.json +1 -1
- package/src/modules/ResultDataProvider.ts +7 -1
- package/src/tests/modules/ResultDataProvider.test.ts +63 -0
package/package.json
CHANGED
|
@@ -864,7 +864,13 @@ export default class ResultDataProvider {
|
|
|
864
864
|
return !linkedBaseKeys.has(baseKey);
|
|
865
865
|
});
|
|
866
866
|
const missingFamily = [...expectedFamilyCodes].filter((code) => !linkedFullCodes.has(code));
|
|
867
|
-
|
|
867
|
+
// Direction B is family-based: if any member of a family is mentioned in Expected Result,
|
|
868
|
+
// linked members of that same family are not considered "linked but not mentioned".
|
|
869
|
+
const extraLinked = [...linkedFullCodes].filter((code) => {
|
|
870
|
+
const baseKey = this.toRequirementKey(code);
|
|
871
|
+
if (!baseKey) return false;
|
|
872
|
+
return !mentionedBaseKeys.has(baseKey);
|
|
873
|
+
});
|
|
868
874
|
const mentionedButNotLinkedByStep = new Map<string, Set<string>>();
|
|
869
875
|
const appendMentionedButNotLinked = (requirementId: string, stepRef: string) => {
|
|
870
876
|
const normalizedRequirementId = this.normalizeMewpRequirementCodeWithSuffix(requirementId);
|
|
@@ -1903,6 +1903,69 @@ describe('ResultDataProvider', () => {
|
|
|
1903
1903
|
);
|
|
1904
1904
|
});
|
|
1905
1905
|
|
|
1906
|
+
it('should not flag linked child as Direction B when parent family is mentioned in Expected Result', async () => {
|
|
1907
|
+
jest.spyOn(resultDataProvider as any, 'fetchTestPlanName').mockResolvedValueOnce('Plan A');
|
|
1908
|
+
jest.spyOn(resultDataProvider as any, 'fetchTestSuites').mockResolvedValueOnce([{ testSuiteId: 1 }]);
|
|
1909
|
+
jest.spyOn(resultDataProvider as any, 'fetchTestData').mockResolvedValueOnce([
|
|
1910
|
+
{
|
|
1911
|
+
testPointsItems: [{ testCaseId: 301, testCaseName: 'TC 301' }],
|
|
1912
|
+
testCasesItems: [
|
|
1913
|
+
{
|
|
1914
|
+
workItem: {
|
|
1915
|
+
id: 301,
|
|
1916
|
+
workItemFields: [{ key: 'Steps', value: '<steps></steps>' }],
|
|
1917
|
+
},
|
|
1918
|
+
},
|
|
1919
|
+
],
|
|
1920
|
+
},
|
|
1921
|
+
]);
|
|
1922
|
+
jest.spyOn(resultDataProvider as any, 'fetchMewpL2Requirements').mockResolvedValueOnce([
|
|
1923
|
+
{
|
|
1924
|
+
workItemId: 7001,
|
|
1925
|
+
requirementId: 'SR0054',
|
|
1926
|
+
baseKey: 'SR0054',
|
|
1927
|
+
title: 'Parent 0054',
|
|
1928
|
+
responsibility: 'ESUK',
|
|
1929
|
+
linkedTestCaseIds: [],
|
|
1930
|
+
areaPath: 'MEWP\\Customer Requirements\\Level 2',
|
|
1931
|
+
},
|
|
1932
|
+
]);
|
|
1933
|
+
jest.spyOn(resultDataProvider as any, 'buildLinkedRequirementsByTestCase').mockResolvedValueOnce(
|
|
1934
|
+
new Map([
|
|
1935
|
+
[
|
|
1936
|
+
301,
|
|
1937
|
+
{
|
|
1938
|
+
baseKeys: new Set(['SR0054']),
|
|
1939
|
+
fullCodes: new Set(['SR0054-1']),
|
|
1940
|
+
},
|
|
1941
|
+
],
|
|
1942
|
+
])
|
|
1943
|
+
);
|
|
1944
|
+
jest.spyOn((resultDataProvider as any).testStepParserHelper, 'parseTestSteps').mockResolvedValueOnce([
|
|
1945
|
+
{
|
|
1946
|
+
stepId: '1',
|
|
1947
|
+
stepPosition: '1',
|
|
1948
|
+
action: '',
|
|
1949
|
+
expected: 'SR0054',
|
|
1950
|
+
isSharedStepTitle: false,
|
|
1951
|
+
},
|
|
1952
|
+
]);
|
|
1953
|
+
|
|
1954
|
+
const result = await (resultDataProvider as any).getMewpInternalValidationFlatResults(
|
|
1955
|
+
'123',
|
|
1956
|
+
mockProjectName,
|
|
1957
|
+
[1]
|
|
1958
|
+
);
|
|
1959
|
+
|
|
1960
|
+
expect(result.rows).toHaveLength(1);
|
|
1961
|
+
expect(result.rows[0]).toEqual(
|
|
1962
|
+
expect.objectContaining({
|
|
1963
|
+
'Test Case ID': 301,
|
|
1964
|
+
'Linked but Not Mentioned': '',
|
|
1965
|
+
})
|
|
1966
|
+
);
|
|
1967
|
+
});
|
|
1968
|
+
|
|
1906
1969
|
it('should produce one detailed row per test case with correct bidirectional discrepancies', async () => {
|
|
1907
1970
|
const mockDetailedStepsByTestCase = new Map<number, any[]>([
|
|
1908
1971
|
[
|