@elisra-devops/docgen-data-provider 1.126.0 → 1.128.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.
@@ -130,10 +130,10 @@ describe('TestStepParserHelper', () => {
130
130
  `${mockOrgUrl}/_apis/wit/workitems/999/revisions/5`,
131
131
  mockToken
132
132
  );
133
- expect(result).toHaveLength(2); // Title + 1 step
134
- expect(result[0].isSharedStepTitle).toBe(true);
135
- expect(result[0].action).toContain('Shared Step Title');
136
- expect(result[1].action).toBe('Shared Step Action');
133
+ expect(result).toHaveLength(1); // shared step only (no title row)
134
+ expect(result[0].isSharedStepTitle).toBe(false);
135
+ expect(result[0].action).toBe('Shared Step Action');
136
+ expect(result[0].stepPosition).toBe('1');
137
137
  });
138
138
 
139
139
  it('should parse shared steps without revision lookup', async () => {
@@ -170,7 +170,7 @@ describe('TestStepParserHelper', () => {
170
170
  `${mockOrgUrl}/_apis/wit/workitems/999`,
171
171
  mockToken
172
172
  );
173
- expect(result).toHaveLength(2);
173
+ expect(result).toHaveLength(1); // shared step only (no title row)
174
174
  });
175
175
 
176
176
  it('should handle shared step fetch error by logging and rethrowing', async () => {
@@ -273,11 +273,12 @@ describe('TestStepParserHelper', () => {
273
273
  const result = await testStepParserHelper.parseTestSteps(xmlSteps, sharedStepIdToRevisionLookupMap);
274
274
 
275
275
  // Assert
276
- expect(result).toHaveLength(3); // 1 regular + 1 title + 1 shared step
276
+ expect(result).toHaveLength(2); // 1 regular + 1 shared substep (no title row)
277
277
  expect(result[0].stepId).toBe('1');
278
278
  expect(result[0].action).toBe('Regular Step');
279
- expect(result[1].isSharedStepTitle).toBe(true);
280
- expect(result[2].action).toBe('Nested Shared Action');
279
+ expect(result[0].stepPosition).toBe('1');
280
+ expect(result[1].action).toBe('Nested Shared Action');
281
+ expect(result[1].stepPosition).toBe('2');
281
282
  });
282
283
 
283
284
  it('should handle parent step ID for nested steps', async () => {
@@ -42,17 +42,10 @@ export default class TestStepParserHelper {
42
42
  const stepsList = await this.parseTestSteps(
43
43
  stepsXML,
44
44
  sharedStepIdToRevisionLookupMap,
45
- `${parentStepPosition}.`,
45
+ parentStepPosition,
46
46
  parentStepId
47
47
  );
48
- const titleObj = {
49
- stepId: parentStepId,
50
- stepPosition: parentStepPosition,
51
- action: `<b>${sharedStepTitle}<b/>`,
52
- expected: '',
53
- isSharedStepTitle: true,
54
- };
55
- sharedStepsList = [titleObj, ...stepsList];
48
+ sharedStepsList = stepsList;
56
49
  }
57
50
  return sharedStepsList;
58
51
  } catch (err: any) {
@@ -164,6 +157,14 @@ export default class TestStepParserHelper {
164
157
  level,
165
158
  parentStepId
166
159
  );
160
+ if (level === '') {
161
+ const flatSteps = stepsList.filter((s) => !s.isSharedStepTitle);
162
+ flatSteps.forEach((step, i) => {
163
+ step.originalStepPosition = step.stepPosition;
164
+ step.stepPosition = String(i + 1);
165
+ });
166
+ return flatSteps;
167
+ }
167
168
  return stepsList;
168
169
  } catch (err: any) {
169
170
  logger.error(