From 042745c52a225bc3fd4ff5873419e1367fc0926a Mon Sep 17 00:00:00 2001 From: shrimbly Date: Fri, 23 Jan 2026 14:24:44 +1300 Subject: [PATCH] test: fix PromptNode test for blur-based update The PromptNode now uses local state and only updates on blur to prevent cursor jumping. Update test to trigger blur after change. Co-Authored-By: Claude Opus 4.5 --- src/components/__tests__/PromptNode.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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",