diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx index 977d2bed..dddec3b2 100644 --- a/ui/src/components/IssueChatThread.test.tsx +++ b/ui/src/components/IssueChatThread.test.tsx @@ -1487,6 +1487,49 @@ describe("IssueChatThread", () => { }); }); + it("invokes the cancel callback for pending question interactions", async () => { + const root = createRoot(container); + const onCancelInteraction = vi.fn(async () => undefined); + + await act(async () => { + root.render( + + {}} + onCancelInteraction={onCancelInteraction} + showComposer={false} + enableLiveTranscriptPolling={false} + /> + , + ); + }); + + const cancelButton = Array.from(container.querySelectorAll("button")).find((button) => + button.textContent?.includes("Cancel question"), + ); + expect(cancelButton).toBeTruthy(); + + await act(async () => { + cancelButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })); + }); + + expect(onCancelInteraction).toHaveBeenCalledWith( + expect.objectContaining({ + id: "interaction-question-1", + kind: "ask_user_questions", + }), + ); + + act(() => { + root.unmount(); + }); + }); + it("folds expired request confirmations into an activity row by default", async () => { const root = createRoot(container); diff --git a/ui/src/components/IssueThreadInteractionCard.tsx b/ui/src/components/IssueThreadInteractionCard.tsx index d48bd5b1..a05f0dc2 100644 --- a/ui/src/components/IssueThreadInteractionCard.tsx +++ b/ui/src/components/IssueThreadInteractionCard.tsx @@ -807,8 +807,8 @@ function AskUserQuestionsCard({ ) : ( "Cancel question" )} - - ) : null} + + ) : null}