()
| 4 | |
| 5 | const node = (id: number, fields: Partial<GraphNode> = {}): GraphNode => ({ id, name: `node-${id}`, label: 'Function', x: 0, y: 0, z: 0, size: 1, color: '#fff', ...fields }); |
| 6 | function fixture(): GraphData { |
| 7 | return { |
| 8 | nodes: [node(1, { name: 'main', qualified_name: 'app.main', file_path: 'src/main.c', start_line: 8, end_line: 21, status: 'entry', in_calls: 0, out_calls: 2 }), node(2, { name: 'initialize' }), node(3, { name: 'caller' })], |
| 9 | edges: [{ source: 1, target: 2, type: 'CALLS' }, { source: 3, target: 1, type: 'CALLS' }, { source: 2, target: 3, type: 'IMPORTS' }], |
| 10 | total_nodes: 200, |
| 11 | }; |
| 12 | } |
| 13 | function snapshot(graph: GraphData) { |
| 14 | const context = galaxyNodeContext(graph, 1, 'sample', 'snapshot'); |
| 15 | expect(context, 'an existing selected node produces a context snapshot').toBeDefined(); |
no test coverage detected