From f983311180165d8d9e5f8bd5b7285351ec9f92ca Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 12 Aug 2026 19:15:28 +0000 Subject: [PATCH] test(ui): cover clearing task assignee Co-Authored-By: Paperclip --- .../task-chat/TaskChatComposer.test.tsx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ui/src/components/task-chat/TaskChatComposer.test.tsx b/ui/src/components/task-chat/TaskChatComposer.test.tsx index 482e2f8ca3f..80fb83920f4 100644 --- a/ui/src/components/task-chat/TaskChatComposer.test.tsx +++ b/ui/src/components/task-chat/TaskChatComposer.test.tsx @@ -633,6 +633,40 @@ describe("TaskChatComposer", () => { ); }); + it("can clear the current assignee from the searchable combobox", async () => { + const onAdd = vi.fn().mockResolvedValue(undefined); + render( + , + ); + + const trigger = container.querySelector('[data-testid="task-chat-composer-assignee"]'); + flushSync(() => trigger?.click()); + await flushAsync(); + + const noAssigneeOption = Array.from( + document.body.querySelectorAll('button[type="button"]'), + ).find((button) => button !== trigger && button.textContent?.includes("No assignee")); + expect(noAssigneeOption).not.toBeUndefined(); + + flushSync(() => noAssigneeOption?.click()); + await new Promise((resolve) => requestAnimationFrame(() => resolve())); + typeText("Please unassign this."); + pressKey("Enter", { metaKey: true }); + await flushAsync(); + + expect(onAdd).toHaveBeenCalledWith( + "Please unassign this.", + undefined, + { assigneeAgentId: null, assigneeUserId: null }, + ); + }); + describe("draft persistence", () => { const draftKey = "task-chat-draft:issue-1";