@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
|
@@ -1541,6 +1541,58 @@ describe('ResultDataProvider', () => {
|
|
|
1541
1541
|
'Validation Status': 'Fail',
|
|
1542
1542
|
}));
|
|
1543
1543
|
});
|
|
1544
|
+
it('should not flag linked child as Direction B when parent family is mentioned in Expected Result', async () => {
|
|
1545
|
+
jest.spyOn(resultDataProvider, 'fetchTestPlanName').mockResolvedValueOnce('Plan A');
|
|
1546
|
+
jest.spyOn(resultDataProvider, 'fetchTestSuites').mockResolvedValueOnce([{ testSuiteId: 1 }]);
|
|
1547
|
+
jest.spyOn(resultDataProvider, 'fetchTestData').mockResolvedValueOnce([
|
|
1548
|
+
{
|
|
1549
|
+
testPointsItems: [{ testCaseId: 301, testCaseName: 'TC 301' }],
|
|
1550
|
+
testCasesItems: [
|
|
1551
|
+
{
|
|
1552
|
+
workItem: {
|
|
1553
|
+
id: 301,
|
|
1554
|
+
workItemFields: [{ key: 'Steps', value: '<steps></steps>' }],
|
|
1555
|
+
},
|
|
1556
|
+
},
|
|
1557
|
+
],
|
|
1558
|
+
},
|
|
1559
|
+
]);
|
|
1560
|
+
jest.spyOn(resultDataProvider, 'fetchMewpL2Requirements').mockResolvedValueOnce([
|
|
1561
|
+
{
|
|
1562
|
+
workItemId: 7001,
|
|
1563
|
+
requirementId: 'SR0054',
|
|
1564
|
+
baseKey: 'SR0054',
|
|
1565
|
+
title: 'Parent 0054',
|
|
1566
|
+
responsibility: 'ESUK',
|
|
1567
|
+
linkedTestCaseIds: [],
|
|
1568
|
+
areaPath: 'MEWP\\Customer Requirements\\Level 2',
|
|
1569
|
+
},
|
|
1570
|
+
]);
|
|
1571
|
+
jest.spyOn(resultDataProvider, 'buildLinkedRequirementsByTestCase').mockResolvedValueOnce(new Map([
|
|
1572
|
+
[
|
|
1573
|
+
301,
|
|
1574
|
+
{
|
|
1575
|
+
baseKeys: new Set(['SR0054']),
|
|
1576
|
+
fullCodes: new Set(['SR0054-1']),
|
|
1577
|
+
},
|
|
1578
|
+
],
|
|
1579
|
+
]));
|
|
1580
|
+
jest.spyOn(resultDataProvider.testStepParserHelper, 'parseTestSteps').mockResolvedValueOnce([
|
|
1581
|
+
{
|
|
1582
|
+
stepId: '1',
|
|
1583
|
+
stepPosition: '1',
|
|
1584
|
+
action: '',
|
|
1585
|
+
expected: 'SR0054',
|
|
1586
|
+
isSharedStepTitle: false,
|
|
1587
|
+
},
|
|
1588
|
+
]);
|
|
1589
|
+
const result = await resultDataProvider.getMewpInternalValidationFlatResults('123', mockProjectName, [1]);
|
|
1590
|
+
expect(result.rows).toHaveLength(1);
|
|
1591
|
+
expect(result.rows[0]).toEqual(expect.objectContaining({
|
|
1592
|
+
'Test Case ID': 301,
|
|
1593
|
+
'Linked but Not Mentioned': '',
|
|
1594
|
+
}));
|
|
1595
|
+
});
|
|
1544
1596
|
it('should produce one detailed row per test case with correct bidirectional discrepancies', async () => {
|
|
1545
1597
|
const mockDetailedStepsByTestCase = new Map([
|
|
1546
1598
|
[
|