From 7fd390a4d0c5adbd4e189a1563e9c5e64554c9d4 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Mon, 8 Jun 2026 12:01:14 -0700 Subject: [PATCH] FN-6019: expand dependency graph full-width layout coverage Broaden dependency graph layout coverage for empty and populated desktop/mobile surfaces. - replace two separate full-width layout tests with a table-driven suite - cover both empty and populated graph states on desktop-width and mobile-width surfaces - keep the flex-parent fill assertion shared across all enumerated surfaces Files changed: .../src/__tests__/DependencyGraph.test.tsx | 37 +++++++++++++++------- 1 file changed, 25 insertions(+), 12 deletions(-) Fusion-Task-Id: FN-6019 Fusion-Task-Lineage: a34b2bdd-d489-4e84-9604-e6265bce733a --- .../src/__tests__/DependencyGraph.test.tsx | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/plugins/fusion-plugin-dependency-graph/src/__tests__/DependencyGraph.test.tsx b/plugins/fusion-plugin-dependency-graph/src/__tests__/DependencyGraph.test.tsx index 166e074a29..e2962e4e71 100644 --- a/plugins/fusion-plugin-dependency-graph/src/__tests__/DependencyGraph.test.tsx +++ b/plugins/fusion-plugin-dependency-graph/src/__tests__/DependencyGraph.test.tsx @@ -139,18 +139,31 @@ describe("DependencyGraph", () => { expect(screen.getByText(/No active tasks/i)).toBeTruthy(); }); - it("fills its flex parent in the empty state", () => { - const graph = renderInProjectContent([], "100%"); + it.each([ + { label: "empty desktop-width surface", tasks: [], width: "100%", expectedNodeIds: [] }, + { label: "empty mobile-width surface", tasks: [], width: "375px", expectedNodeIds: [] }, + { + label: "populated desktop-width surface", + tasks: [createTask("A", "todo"), createTask("B", "todo", ["A"])], + width: "100%", + expectedNodeIds: ["A", "B"], + }, + { + label: "populated mobile-width surface", + tasks: [createTask("A", "todo"), createTask("B", "todo", ["A"])], + width: "375px", + expectedNodeIds: ["A", "B"], + }, + ])("fills its flex parent in the $label", ({ tasks, width, expectedNodeIds }) => { + const graph = renderInProjectContent(tasks, width); - expect(screen.getByText(/No active tasks/i)).toBeTruthy(); - expectGraphToFillFlexParent(graph); - }); - - it("fills its flex parent with populated tasks on a mobile-width surface", () => { - const graph = renderInProjectContent([createTask("A", "todo"), createTask("B", "todo", ["A"])], "375px"); - - expect(screen.getByTestId("graph-task-node-A")).toBeTruthy(); - expect(screen.getByTestId("graph-task-node-B")).toBeTruthy(); + if (expectedNodeIds.length === 0) { + expect(screen.getByText(/No active tasks/i)).toBeTruthy(); + } else { + for (const nodeId of expectedNodeIds) { + expect(screen.getByTestId(`graph-task-node-${nodeId}`)).toBeTruthy(); + } + } expectGraphToFillFlexParent(graph); });