Browse Source

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
feature/canvas-chatbot-copilot
jiajia 2 months ago
parent
commit
41d9889144
  1. 4
      src/components/__tests__/GenerateVideoNode.test.tsx
  2. 2
      src/components/__tests__/WorkflowCanvas.test.tsx

4
src/components/__tests__/GenerateVideoNode.test.tsx

@ -177,10 +177,10 @@ describe("GenerateVideoNode", () => {
</TestWrapper> </TestWrapper>
); );
// 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("Image")).toBeInTheDocument();
expect(screen.getByText("Prompt")).toBeInTheDocument(); expect(screen.getByText("Prompt")).toBeInTheDocument();
expect(screen.getByText("Video")).toBeInTheDocument(); expect(screen.getAllByText("Video")).toHaveLength(2);
}); });
}); });

2
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 mockZoomIn = vi.fn();
const mockZoomOut = vi.fn(); const mockZoomOut = vi.fn();
const mockSetViewport = vi.fn(); const mockSetViewport = vi.fn();
const mockSetNodes = vi.fn();
vi.mock("@xyflow/react", async () => { vi.mock("@xyflow/react", async () => {
const actual = await vi.importActual("@xyflow/react"); const actual = await vi.importActual("@xyflow/react");
@ -50,6 +51,7 @@ vi.mock("@xyflow/react", async () => {
zoomIn: mockZoomIn, zoomIn: mockZoomIn,
zoomOut: mockZoomOut, zoomOut: mockZoomOut,
setViewport: mockSetViewport, setViewport: mockSetViewport,
setNodes: mockSetNodes,
}), }),
}; };
}); });

Loading…
Cancel
Save