Skip to content

Commit f0dd6eb

Browse files
committed
test(workflows): build the loop fixture's data from a parameter instead of mutating it, and shrink the test-types baseline
1 parent 79591b5 commit f0dd6eb

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎apps/sim/lib/workflows/editing/operations.test.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ mockGetBlock.mockImplementation((type: string) => MOCK_REGISTRY_BLOCKS[type])
166166

167167
vi.mock('@/lib/integrations/availability.server', () => integrationsAvailabilityMock)
168168

169-
function makeLoopWorkflow() {
169+
function makeLoopWorkflow(loopData: Record<string, unknown> = { loopType: 'for', count: 5 }) {
170170
return {
171171
blocks: {
172172
'loop-1': {
@@ -177,7 +177,7 @@ function makeLoopWorkflow() {
177177
enabled: true,
178178
subBlocks: {},
179179
outputs: {},
180-
data: { loopType: 'for', count: 5 },
180+
data: loopData,
181181
},
182182
'condition-1': {
183183
id: 'condition-1',
@@ -691,8 +691,7 @@ describe('a block rename', () => {
691691
})
692692

693693
it('rewrites references a loop holds in its collection and conditions, and in the loop record', () => {
694-
const workflow = makeLoopWorkflow()
695-
Object.assign(workflow.blocks['loop-1'].data, {
694+
const workflow = makeLoopWorkflow({
696695
loopType: 'forEach',
697696
collection: '<agent1.items>',
698697
whileCondition: '<agent1.more> === true',

‎scripts/check-test-types.baseline.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,9 +2283,6 @@
22832283
"apps/sim/lib/workflows/dynamic-handle-topology.test.ts": {
22842284
"TS2352": 1
22852285
},
2286-
"apps/sim/lib/workflows/editing/operations.test.ts": {
2287-
"TS2353": 1
2288-
},
22892286
"apps/sim/lib/workflows/editing/validation.test.ts": {
22902287
"TS2322": 1
22912288
},

0 commit comments

Comments
 (0)