(overrides: WorkflowGraphOverrides = {})
| 47 | }; |
| 48 | |
| 49 | const buildWorkflowGraph = (overrides: WorkflowGraphOverrides = {}): WorkflowGraphDto => { |
| 50 | const baseGraph: WorkflowGraphDto = { |
| 51 | name: overrides.name ?? `Test Workflow ${randomUUID().slice(0, 8)}`, |
| 52 | description: overrides.description ?? 'Integration test workflow', |
| 53 | nodes: (overrides.nodes ?? [normalizeNode()]).map((node) => normalizeNode(node)), |
| 54 | edges: overrides.edges ?? [], |
| 55 | viewport: overrides.viewport ?? { x: 0, y: 0, zoom: 1 }, |
| 56 | }; |
| 57 | |
| 58 | // Validate with Zod schema to ensure correct structure |
| 59 | return WorkflowGraphSchema.parse(baseGraph); |
| 60 | }; |
| 61 | |
| 62 | const readJson = async <T>(response: Response): Promise<T> => (await response.json()) as T; |
| 63 |
no test coverage detected