* Helper to create a DAG node for testing
(
id: string,
outgoingEdges: Array<{ target: string; sourceHandle?: string }> = [],
metadata: Partial<NodeMetadata> = {}
)
| 15 | * Helper to create a DAG node for testing |
| 16 | */ |
| 17 | function createNode( |
| 18 | id: string, |
| 19 | outgoingEdges: Array<{ target: string; sourceHandle?: string }> = [], |
| 20 | metadata: Partial<NodeMetadata> = {} |
| 21 | ): DAGNode { |
| 22 | const edges = new Map<string, DAGEdge>() |
| 23 | for (const edge of outgoingEdges) { |
| 24 | edges.set(edge.target, { target: edge.target, sourceHandle: edge.sourceHandle }) |
| 25 | } |
| 26 | |
| 27 | return { |
| 28 | id, |
| 29 | block: { |
| 30 | id, |
| 31 | position: { x: 0, y: 0 }, |
| 32 | config: { tool: 'test', params: {} }, |
| 33 | inputs: {}, |
| 34 | outputs: {}, |
| 35 | metadata: { id: 'test', name: `block-${id}`, category: 'tools' }, |
| 36 | enabled: true, |
| 37 | }, |
| 38 | incomingEdges: new Set<string>(), |
| 39 | outgoingEdges: edges, |
| 40 | metadata: { |
| 41 | isParallelBranch: false, |
| 42 | isLoopNode: false, |
| 43 | isSentinel: false, |
| 44 | ...metadata, |
| 45 | }, |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Helper to create a DAG for testing |
no test coverage detected