diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/use-prompt-editor.test.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/use-prompt-editor.test.tsx index 7cd9a2281c0..4a8696a0f15 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/use-prompt-editor.test.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/use-prompt-editor.test.tsx @@ -116,7 +116,7 @@ describe('usePromptEditor mention menu dismissal', () => { unmount() }) - it('does not reopen after the user clicks away, even if the caret lands back inside the open mention', () => { + it('stays closed across repeated clicks at the same position after the user clicks away, even if the caret lands back inside the open mention', () => { const { result, textarea, unmount } = renderPromptEditor({ workspaceId: 'ws-1' }) result().plusMenuRef.current = openMenu @@ -134,10 +134,12 @@ describe('usePromptEditor mention menu dismissal', () => { }) expect(result().mentionQuery).toBeNull() - act(() => { - textarea.setSelectionRange(2, 2) - result().handleSelectAdjust() - }) + for (let i = 0; i < 3; i++) { + act(() => { + textarea.setSelectionRange(2, 2) + result().handleSelectAdjust() + }) + } expect(result().mentionQuery).toBeNull() expect(openMenu.open).toHaveBeenCalledTimes(1)