@elisra-devops/docgen-data-provider 1.102.0 → 1.103.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.
@@ -894,6 +894,44 @@ describe('ResultDataProvider', () => {
894
894
  });
895
895
  });
896
896
  describe('getMewpL2CoverageFlatResults', () => {
897
+ it('should split SR prefix into SR # + L2 REQ Title while preserving full title', () => {
898
+ const row = resultDataProvider.createMewpCoverageRow({
899
+ workItemId: 5054,
900
+ requirementId: 'SR0054',
901
+ title: 'SR0054 - Engine startup coverage',
902
+ owner: 'ESUK',
903
+ subSystem: 'Propulsion',
904
+ responsibility: 'ESUK',
905
+ }, 'Pass', { id: '', title: '', responsibility: '' }, { l3Id: '', l3Title: '', l4Id: '', l4Title: '' });
906
+ expect(row).toEqual(expect.objectContaining({
907
+ 'L2 REQ ID': '5054',
908
+ 'SR #': 'SR0054',
909
+ 'L2 REQ Title': 'Engine startup coverage',
910
+ 'L2 REQ Full Title': 'SR0054 - Engine startup coverage',
911
+ 'L2 Owner': 'ESUK',
912
+ 'L2 SubSystem': 'Propulsion',
913
+ }));
914
+ });
915
+ it('should keep full title when title is only the SR token', () => {
916
+ const row = resultDataProvider.createMewpCoverageRow({
917
+ workItemId: 9999,
918
+ requirementId: 'SR9999',
919
+ title: 'SR9999',
920
+ owner: 'IL',
921
+ subSystem: '',
922
+ responsibility: 'IL',
923
+ }, 'Not Run', { id: '', title: '', responsibility: '' }, { l3Id: '', l3Title: '', l4Id: '', l4Title: '' });
924
+ expect(row['L2 REQ Title']).toBe('SR9999');
925
+ expect(row['L2 REQ Full Title']).toBe('SR9999');
926
+ expect(row['L2 Owner']).toBe('IL');
927
+ });
928
+ it('should resolve L2 run status precedence: Fail > Not Run > Pass', () => {
929
+ const resolve = resultDataProvider.resolveMewpL2RunStatus.bind(resultDataProvider);
930
+ expect(resolve({ passed: 2, failed: 1, notRun: 3, hasAnyTestCase: true })).toBe('Fail');
931
+ expect(resolve({ passed: 5, failed: 0, notRun: 1, hasAnyTestCase: true })).toBe('Not Run');
932
+ expect(resolve({ passed: 1, failed: 0, notRun: 0, hasAnyTestCase: true })).toBe('Pass');
933
+ expect(resolve({ passed: 0, failed: 0, notRun: 0, hasAnyTestCase: true })).toBe('Not Run');
934
+ });
897
935
  it('should fetch MEWP scoped test data from selected suites', async () => {
898
936
  jest.spyOn(resultDataProvider, 'fetchTestPlanName').mockResolvedValueOnce('Plan A');
899
937
  const scopedSpy = jest
@@ -987,7 +1025,7 @@ describe('ResultDataProvider', () => {
987
1025
  const result = await resultDataProvider.getMewpL2CoverageFlatResults('123', mockProjectName, [1]);
988
1026
  expect(result).toEqual(expect.objectContaining({
989
1027
  sheetName: expect.stringContaining('MEWP L2 Coverage'),
990
- columnOrder: expect.arrayContaining(['L2 REQ ID', 'L2 REQ Title', 'L2 Run Status']),
1028
+ columnOrder: expect.arrayContaining(['L2 REQ ID', 'SR #', 'L2 REQ Title', 'L2 Owner', 'L2 Run Status']),
991
1029
  }));
992
1030
  const covered = result.rows.find((row) => row['L2 REQ ID'] === '5001');
993
1031
  const inferredByStepText = result.rows.find((row) => row['L2 REQ ID'] === '5002');