From 41d9889144a056bd8bc7e453642c4f1fdd65e9a0 Mon Sep 17 00:00:00 2001 From: jiajia Date: Sat, 16 May 2026 21:25:58 +0800 Subject: [PATCH] Keep master merge tests aligned with current handles The TEST-s line can fast-forward into master, but the verification gate exposed stale test assumptions: video nodes now expose both input and output Video labels, and WorkflowCanvas tests need the ReactFlow setNodes API used by image node resizing. Constraint: Preserve runtime behavior while making the merge gate reliable Rejected: Change production node labels | the UI behavior is intentional and already deployed on TEST-s Confidence: high Scope-risk: narrow Tested: npm run test:run -- src/components/__tests__/GenerateVideoNode.test.tsx src/components/__tests__/WorkflowCanvas.test.tsx Tested: npm run test:run Tested: npm run build --- src/components/__tests__/GenerateVideoNode.test.tsx | 4 ++-- src/components/__tests__/WorkflowCanvas.test.tsx | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/__tests__/GenerateVideoNode.test.tsx b/src/components/__tests__/GenerateVideoNode.test.tsx index 37fb033b..494e2b23 100644 --- a/src/components/__tests__/GenerateVideoNode.test.tsx +++ b/src/components/__tests__/GenerateVideoNode.test.tsx @@ -177,10 +177,10 @@ describe("GenerateVideoNode", () => { ); - // Should have Image and Prompt labels for inputs, Video for output + // Should have Image and Prompt labels for inputs, plus Video labels for input and output. expect(screen.getByText("Image")).toBeInTheDocument(); expect(screen.getByText("Prompt")).toBeInTheDocument(); - expect(screen.getByText("Video")).toBeInTheDocument(); + expect(screen.getAllByText("Video")).toHaveLength(2); }); }); diff --git a/src/components/__tests__/WorkflowCanvas.test.tsx b/src/components/__tests__/WorkflowCanvas.test.tsx index 9e889a6b..55957061 100644 --- a/src/components/__tests__/WorkflowCanvas.test.tsx +++ b/src/components/__tests__/WorkflowCanvas.test.tsx @@ -39,6 +39,7 @@ const mockGetViewport = vi.fn(() => ({ x: 0, y: 0, zoom: 1 })); const mockZoomIn = vi.fn(); const mockZoomOut = vi.fn(); const mockSetViewport = vi.fn(); +const mockSetNodes = vi.fn(); vi.mock("@xyflow/react", async () => { const actual = await vi.importActual("@xyflow/react"); @@ -50,6 +51,7 @@ vi.mock("@xyflow/react", async () => { zoomIn: mockZoomIn, zoomOut: mockZoomOut, setViewport: mockSetViewport, + setNodes: mockSetNodes, }), }; });