Skip to content

Commit a921843

Browse files
ElliotDrelclaude
andcommitted
test(web): flush modified chip clicks before asserting the editor stays closed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent eb5b34f commit a921843

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.browser.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ it.each(["click", "Enter", " "])(
144144
const event = new MouseEvent("click", { bubbles: true, cancelable: true, ...init });
145145
// Keep the browser on the test page while exercising the link's modifier handling.
146146
chip.element().addEventListener("click", (event) => event.preventDefault(), { once: true });
147-
chip.element().dispatchEvent(event);
147+
await act(() => {
148+
chip.element().dispatchEvent(event);
149+
});
148150
await expect.element(page.getByLabelText("Comment on selected text")).not.toBeInTheDocument();
149151
}
150152
if (activation === "click") {

0 commit comments

Comments
 (0)