diff --git a/desktop/tests/e2e/forum-agent-invitation.spec.ts b/desktop/tests/e2e/forum-agent-invitation.spec.ts index b17f5fcc04..e3898085ba 100644 --- a/desktop/tests/e2e/forum-agent-invitation.spec.ts +++ b/desktop/tests/e2e/forum-agent-invitation.spec.ts @@ -430,8 +430,17 @@ for (const stage of ["add", "publish"] as const) { await expect( page.getByRole("button", { name: "Remove attachment" }), ).toBeVisible(); - if (replacement !== null) + if (replacement === "") { + // fill("") presses Delete over a DOM selection ProseMirror may not + // have synced yet; select through the editor's own keymap instead. + await page.getByTestId("message-input").click(); + await page.keyboard.press("ControlOrMeta+a"); + await page.keyboard.press("Delete"); + } else if (replacement !== null) { await page.getByTestId("message-input").fill(replacement); + } + if (replacement !== null) + await expect(page.getByTestId("message-input")).toHaveText(replacement); await navigate(1); await releaseForumGate(page); expect(