(layout: { data: GraphData }, id: number)
| 101 | it('keeps the root at the origin across expansions, for a fresh trace and for a previous picture without it', () => { |
| 102 | const origin = { x: 0, y: 0, z: 0 }; |
| 103 | const rootAt = (layout: { data: GraphData }, id: number) => { |
| 104 | const found = layout.data.nodes.find(candidate => candidate.id === id)!; |
| 105 | return { x: found.x + 0, y: found.y + 0, z: found.z + 0 }; |
| 106 | }; |
| 107 | const first = layoutOrganicClusters({ nodes: [node(0), node(1), node(2)], edges: [edge(0, 1), edge(2, 0)], total_nodes: 3 }, |
| 108 | { rootIds: new Set([0]) }); |
| 109 | expect(rootAt(first, 0)).toEqual(origin); |
no outgoing calls
no test coverage detected