diff --git a/src/components/__tests__/PromptNode.test.tsx b/src/components/__tests__/PromptNode.test.tsx index aa6a160f..6a5a1ea8 100644 --- a/src/components/__tests__/PromptNode.test.tsx +++ b/src/components/__tests__/PromptNode.test.tsx @@ -126,6 +126,27 @@ describe("PromptNode", () => { expect(mockRemoveNode).toHaveBeenCalledWith("test-prompt-1"); }); + it("should hide unavailable rich text actions while editing", () => { + render( + + + + ); + + fireEvent.doubleClick(screen.getByRole("button", { name: "Double-click to edit" })); + + expect(screen.queryByLabelText("Body")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Align text")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Numbered list")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Bold")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Italic")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Strikethrough")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Link")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Table")).not.toBeInTheDocument(); + expect(screen.queryByLabelText("Expand editor")).not.toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Delete" })).toBeInTheDocument(); + }); + it("should render text output handle", () => { const { container } = render( diff --git a/src/components/nodes/PromptNode.tsx b/src/components/nodes/PromptNode.tsx index d800377d..5035239d 100644 --- a/src/components/nodes/PromptNode.tsx +++ b/src/components/nodes/PromptNode.tsx @@ -45,22 +45,6 @@ function DeleteIcon() { ); } -function ToolbarDivider() { - return