@elisra-devops/docgen-data-provider 1.98.0 → 1.99.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elisra-devops/docgen-data-provider",
3
- "version": "1.98.0",
3
+ "version": "1.99.0",
4
4
  "description": "A document generator data provider, aimed to retrive data from azure devops",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4358,10 +4358,25 @@ export default class ResultDataProvider {
4358
4358
  }
4359
4359
  }
4360
4360
  for (const point of testItem.testPointsItems) {
4361
- const testCase = testCaseById.get(Number(point.testCaseId));
4362
- if (!testCase) continue;
4361
+ const pointTestCaseId = Number(point?.testCaseId || 0);
4362
+ const testCase =
4363
+ testCaseById.get(pointTestCaseId) || {
4364
+ workItem: { id: pointTestCaseId, workItemFields: [] },
4365
+ };
4366
+ if (!Number.isFinite(pointTestCaseId) || pointTestCaseId <= 0) continue;
4367
+
4368
+ if (!testCaseById.has(pointTestCaseId) && isTestReporter) {
4369
+ logger.debug(
4370
+ `[RunlessResolver] Missing suite testCase payload for point testCaseId=${String(
4371
+ pointTestCaseId
4372
+ )}; using point fallback for alignment`
4373
+ );
4374
+ }
4363
4375
 
4364
- if (testCase.workItem.workItemFields.length === 0) {
4376
+ const testCaseWorkItemFields = Array.isArray(testCase?.workItem?.workItemFields)
4377
+ ? testCase.workItem.workItemFields
4378
+ : [];
4379
+ if (testCaseWorkItemFields.length === 0) {
4365
4380
  logger.warn(`Could not fetch the steps from WI ${JSON.stringify(testCase.workItem.id)}`);
4366
4381
  if (!isTestReporter) {
4367
4382
  continue;
@@ -6080,6 +6080,56 @@ describe('ResultDataProvider', () => {
6080
6080
  expect(res).toHaveLength(1);
6081
6081
  expect(res[0].stepNo).toBeUndefined();
6082
6082
  });
6083
+
6084
+ it('should keep runless step rows even when suite testCasesItems entry is missing', () => {
6085
+ const testData = [
6086
+ {
6087
+ testGroupName: 'G',
6088
+ testPointsItems: [{ testCaseId: 217916, testCaseName: 'TC 217916', testCaseUrl: 'u' }],
6089
+ testCasesItems: [],
6090
+ },
6091
+ ];
6092
+ const iterations = [
6093
+ {
6094
+ testCaseId: 217916,
6095
+ lastRunId: undefined,
6096
+ lastResultId: undefined,
6097
+ iteration: {
6098
+ actionResults: [
6099
+ {
6100
+ stepIdentifier: '16',
6101
+ stepPosition: '1',
6102
+ action: 'A',
6103
+ expected: 'E',
6104
+ outcome: 'Unspecified',
6105
+ isSharedStepTitle: false,
6106
+ errorMessage: '',
6107
+ },
6108
+ ],
6109
+ },
6110
+ testCaseResult: 'Not Run',
6111
+ comment: '',
6112
+ runBy: { displayName: 'u' },
6113
+ failureType: '',
6114
+ executionDate: '',
6115
+ configurationName: '',
6116
+ relatedRequirements: [],
6117
+ relatedBugs: [],
6118
+ relatedCRs: [],
6119
+ customFields: {},
6120
+ },
6121
+ ];
6122
+
6123
+ const res = (resultDataProvider as any).alignStepsWithIterationsTestReporter(
6124
+ testData,
6125
+ iterations,
6126
+ ['includeSteps@stepsRunProperties', 'stepRunStatus@stepsRunProperties'],
6127
+ true
6128
+ );
6129
+
6130
+ expect(res).toHaveLength(1);
6131
+ expect(res[0]).toEqual(expect.objectContaining({ stepNo: '1', stepStatus: 'Not Run' }));
6132
+ });
6083
6133
  });
6084
6134
 
6085
6135
  describe('fetchOpenPcrData', () => {