| 59 | } |
| 60 | |
| 61 | function createTestContext( |
| 62 | currentNodeId: string, |
| 63 | loopScope?: LoopScope, |
| 64 | loopExecutions?: Map<string, LoopScope>, |
| 65 | blockOutputs?: Record<string, any>, |
| 66 | parallelBlockMapping?: Map<string, any> |
| 67 | ): ResolutionContext { |
| 68 | return { |
| 69 | executionContext: { |
| 70 | workspaceId: 'workspace-1', |
| 71 | workflowId: 'workflow-1', |
| 72 | executionId: 'execution-1', |
| 73 | loopExecutions: loopExecutions ?? new Map(), |
| 74 | parallelBlockMapping, |
| 75 | }, |
| 76 | executionState: { |
| 77 | getBlockOutput: (id: string) => blockOutputs?.[id], |
| 78 | }, |
| 79 | currentNodeId, |
| 80 | loopScope, |
| 81 | } as ResolutionContext |
| 82 | } |
| 83 | |
| 84 | describe('LoopResolver', () => { |
| 85 | describe('canResolve', () => { |