diff --git a/src/components/__tests__/PromptNode.test.tsx b/src/components/__tests__/PromptNode.test.tsx index cf180c12..a3b3702d 100644 --- a/src/components/__tests__/PromptNode.test.tsx +++ b/src/components/__tests__/PromptNode.test.tsx @@ -80,7 +80,7 @@ describe("PromptNode", () => { expect(textarea).toBeInTheDocument(); }); - it("should call updateNodeData when typing in textarea", () => { + it("should call updateNodeData when typing in textarea and blurring", () => { render( @@ -88,7 +88,9 @@ describe("PromptNode", () => { ); const textarea = screen.getByPlaceholderText("Describe what to generate..."); + fireEvent.focus(textarea); fireEvent.change(textarea, { target: { value: "New prompt text" } }); + fireEvent.blur(textarea); expect(mockUpdateNodeData).toHaveBeenCalledWith("test-prompt-1", { prompt: "New prompt text",