| 116 | const workflowId = 'wf-test' |
| 117 | |
| 118 | const createBlockState = ( |
| 119 | id: string, |
| 120 | subBlocks: Record<string, { id: string; type: string; value: unknown }> |
| 121 | ): BlockState => |
| 122 | ({ |
| 123 | id, |
| 124 | type: 'function', |
| 125 | name: 'Test Block', |
| 126 | position: { x: 0, y: 0 }, |
| 127 | subBlocks: Object.fromEntries( |
| 128 | Object.entries(subBlocks).map(([subId, sb]) => [ |
| 129 | subId, |
| 130 | { id: sb.id, type: sb.type, value: sb.value }, |
| 131 | ]) |
| 132 | ), |
| 133 | outputs: {}, |
| 134 | enabled: true, |
| 135 | }) as BlockState |
| 136 | |
| 137 | beforeEach(() => { |
| 138 | vi.clearAllMocks() |