From f1af1b88c6458d40080529e8d71a0bdec1868a78 Mon Sep 17 00:00:00 2001 From: Logan Johnson Date: Wed, 9 Sep 2026 11:37:27 -0400 Subject: [PATCH] test(desktop): clear the explicit-picker draft with native keypresses The explicit-picker setup in the relay-agent directory-errors spec cleared the seeded draft with fill(""), whose programmatic selectAll can lose the selection to ProseMirror's own selection sync and leave "@quinn" behind in CI, exhausting retries at the picker-empty assertion. Clear the draft with native ControlOrMeta+A and Backspace so the editor applies both steps in its own transaction, and gate immediately on toBeEmpty before opening the picker. Every original directory-error, disabled-row, Tab-completion and retry-recovery assertion is unchanged; no production code, timeout or mock change. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson --- desktop/tests/e2e/mentions.spec.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/desktop/tests/e2e/mentions.spec.ts b/desktop/tests/e2e/mentions.spec.ts index e40365b45d..14091fca18 100644 --- a/desktop/tests/e2e/mentions.spec.ts +++ b/desktop/tests/e2e/mentions.spec.ts @@ -1924,7 +1924,14 @@ for (const explicitPicker of [false, true]) { const input = page.getByTestId("message-input"); await input.fill("@quinn"); if (explicitPicker) { - await input.fill(""); + // Clear the draft with native select-all + Backspace instead of + // fill(""): the programmatic selectAll inside fill can lose the + // selection to ProseMirror's own selection sync and leave "@quinn" + // behind in CI. Real key events let the editor apply both steps + // itself. + await input.press("ControlOrMeta+A"); + await input.press("Backspace"); + await expect(input).toBeEmpty(); await page .getByRole("button", { name: "Mention someone", exact: true }) .click();