Skip to content

Commit 4022435

Browse files
committed
fix failing tests
1 parent 0c95243 commit 4022435

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/backend/src/helpers/__tests__/compute-for-each-parameters.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ describe('getForEachContext', () => {
303303
expect(context).toEqual({
304304
forEachStepIndex: -1,
305305
stepPositions: {},
306+
lastStepId: '',
306307
})
307308
})
308309

@@ -333,7 +334,12 @@ describe('getForEachContext', () => {
333334
const context = getForEachContext(flowWithMultipleForEach)
334335

335336
expect(context.forEachStepIndex).toBe(2)
336-
// expect(context.stepIsInForEach).toBe(true)
337+
expect(context.stepPositions).toEqual({
338+
[flowWithMultipleForEach.steps[0].id]: 1,
339+
[flowWithMultipleForEach.steps[1].id]: 2,
340+
[flowWithMultipleForEach.steps[2].id]: 3,
341+
})
342+
expect(context.lastStepId).toBe(flowWithMultipleForEach.steps[2].id)
337343
})
338344

339345
it('should return correct context when step is before for-each', () => {

packages/backend/src/workers/helpers/make-action-worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ export function makeActionWorker(
163163
}
164164

165165
const isForEach =
166-
currStep.appKey === TOOLBOX_APP_KEY &&
167-
currStep.key === TOOLBOX_ACTIONS.FOR_EACH
166+
currStep?.appKey === TOOLBOX_APP_KEY &&
167+
currStep?.key === TOOLBOX_ACTIONS.FOR_EACH
168168

169169
/**
170170
* FOR-EACH SPECIAL CASE

0 commit comments

Comments
 (0)