MCPcopy Create free account
hub / github.com/ShipSecAI/studio / buildWorkflowGraph

Function buildWorkflowGraph

backend/src/__tests__/backend-integration.test.ts:49–60  ·  view source on GitHub ↗
(overrides: WorkflowGraphOverrides = {})

Source from the content-addressed store, hash-verified

47};
48
49const 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
62const readJson = async <T>(response: Response): Promise<T> => (await response.json()) as T;
63

Callers 1

Calls 2

normalizeNodeFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected