Fix graph flow ancestry and modal sizing
This commit is contained in:
parent
c22ae01fdf
commit
984a4fd993
5 changed files with 91 additions and 43 deletions
|
|
@ -177,6 +177,7 @@ if (centered.width !== 500 || centered.height !== 300) fail("center preserves zo
|
|||
if (centered.x !== positions.get("child-two").x - 250) fail("center x");
|
||||
if (centered.y !== positions.get("child-two").y - 150) fail("center y");
|
||||
if (relationStyle("calls").family !== "Execution") fail("calls family");
|
||||
if (relationStyle("contains").flow !== "forward") fail("contains flow direction");
|
||||
if (relationStyle("reads").flow !== "reverse") fail("reads flow direction");
|
||||
if (relationStyle("documents").flow !== null) fail("documents excluded from flow");
|
||||
if (relationStyle("unknown_relation").family !== "Other") fail("fallback relation family");
|
||||
|
|
@ -188,18 +189,23 @@ const flowData = {
|
|||
{node_id: "caller"},
|
||||
{node_id: "dependency"},
|
||||
{node_id: "reader"},
|
||||
{node_id: "test-class"},
|
||||
{node_id: "test-file"},
|
||||
{node_id: "document"},
|
||||
],
|
||||
edges: [
|
||||
{source_id: "caller", relation: "calls", target_id: "primary"},
|
||||
{source_id: "primary", relation: "depends_on", target_id: "dependency"},
|
||||
{source_id: "primary", relation: "reads", target_id: "reader"},
|
||||
{source_id: "test-class", relation: "contains", target_id: "primary"},
|
||||
{source_id: "test-file", relation: "contains", target_id: "test-class"},
|
||||
{source_id: "document", relation: "documents", target_id: "primary"},
|
||||
],
|
||||
};
|
||||
const flow = buildFlowGraph(flowData);
|
||||
const flowIds = new Set(flow.nodes.map((node) => node.node_id));
|
||||
if (!flowIds.has("caller") || !flowIds.has("dependency") || !flowIds.has("reader")) {
|
||||
if (!flowIds.has("caller") || !flowIds.has("dependency") || !flowIds.has("reader")
|
||||
|| !flowIds.has("test-class") || !flowIds.has("test-file")) {
|
||||
fail("upstream flow membership");
|
||||
}
|
||||
if (flowIds.has("document")) fail("evidence leaked into flow");
|
||||
|
|
@ -212,6 +218,11 @@ const dependencyEdge = flow.edges.find((edge) => edge.relation === "depends_on")
|
|||
if (dependencyEdge.source_id !== "dependency" || dependencyEdge.target_id !== "primary") {
|
||||
fail("dependency semantic reversal");
|
||||
}
|
||||
const containmentEdge = flow.edges.find((edge) => edge.relation === "contains"
|
||||
&& edge.source_id === "test-class");
|
||||
if (!containmentEdge || containmentEdge.target_id !== "primary") {
|
||||
fail("containment ancestry direction");
|
||||
}
|
||||
"""
|
||||
)
|
||||
result = subprocess.run(
|
||||
|
|
@ -254,6 +265,15 @@ if (dependencyEdge.source_id !== "dependency" || dependencyEdge.target_id !== "p
|
|||
self.assertIn('id="node-card"', html)
|
||||
self.assertIn('id="explore-node"', html)
|
||||
self.assertIn('id="explore-card-node"', html)
|
||||
self.assertIn("positionNodeCard(dialog, event)", html)
|
||||
self.assertIn(
|
||||
'renderDetails($("node-card-details"), data.node, data, true, false)', html
|
||||
)
|
||||
self.assertIn("dialog.show();", html)
|
||||
self.assertIn("position: fixed; inset: auto; margin: 0", html)
|
||||
self.assertIn("background: rgba(7, 18, 29, .82)", html)
|
||||
self.assertIn("width: fit-content; height: fit-content", html)
|
||||
self.assertIn("max-width: min(760px, calc(100vw - 32px))", html)
|
||||
self.assertIn('id="left-resizer"', html)
|
||||
self.assertIn('id="right-resizer"', html)
|
||||
self.assertIn('id="view-nodes"', html)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue