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
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user