|
|
|
@ -423,7 +423,7 @@ describe("WorkflowCanvas", () => { |
|
|
|
expect(document.querySelector("textarea")).not.toBeInTheDocument(); |
|
|
|
}); |
|
|
|
|
|
|
|
it("should let smart text enter editing without opening the canvas node menu when preview text is double-clicked", async () => { |
|
|
|
it("should center, zoom, and let smart text enter editing without opening the canvas node menu when preview text is double-clicked", async () => { |
|
|
|
mockGetViewport.mockReturnValue({ x: 0, y: 0, zoom: 0.6 }); |
|
|
|
mockUseWorkflowStore.mockImplementation((selector) => { |
|
|
|
return selector(createDefaultState({ |
|
|
|
@ -457,10 +457,16 @@ describe("WorkflowCanvas", () => { |
|
|
|
|
|
|
|
fireEvent.doubleClick(renderedText); |
|
|
|
|
|
|
|
expect(mockSelectSingleNode).not.toHaveBeenCalledWith("text-1"); |
|
|
|
expect(mockSetCenter).not.toHaveBeenCalled(); |
|
|
|
expect(document.querySelector('[role="textbox"]')).toBeInTheDocument(); |
|
|
|
expect(mockSelectSingleNode).toHaveBeenCalledWith("text-1"); |
|
|
|
expect(mockSetCenter).toHaveBeenCalledWith(360, 230, { |
|
|
|
duration: 260, |
|
|
|
zoom: 2, |
|
|
|
}); |
|
|
|
expect(screen.queryByTestId("canvas-node-menu")).not.toBeInTheDocument(); |
|
|
|
|
|
|
|
await waitFor(() => { |
|
|
|
expect(document.querySelector('[role="textbox"]')).toBeInTheDocument(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
it("should reduce double-click zoom so large media nodes fit within the viewport", async () => { |
|
|
|
|