From 7dca43dc6a77378559dcdf33bab9b6adf23962e3 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 5 Nov 2026 18:34:57 +1100 Subject: [PATCH] test(inbox): wait for the entry reveal before filling the reply in inbox-edit Opening a conversation from the Inbox reveals its entry reply: useMessageReveal focuses that row once the thread target is ready. "Inbox edits an owned reply in place and restores the reply draft" filled the reply composer as soon as its own row showed, so on a slow runner the reveal landed during the fill. In WebKit the row taking focus clears the editor selection, so nothing was inserted, and Cancel edit then restored an empty draft. Wait for the revealed row's focus and two frames before filling, as #2566 did for inbox-archive.spec.mjs. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Matt Toohey --- tests/browser/inbox-edit.spec.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/browser/inbox-edit.spec.mjs b/tests/browser/inbox-edit.spec.mjs index 6379160446..9e12b5c159 100644 --- a/tests/browser/inbox-edit.spec.mjs +++ b/tests/browser/inbox-edit.spec.mjs @@ -1,6 +1,7 @@ import { hoverMessage } from "./message-actions.mjs"; import { test, expect } from "./fixture.mjs"; import { openPage } from "./navigation.mjs"; +import { frames } from "./timeline.mjs"; // Browser boundary: Inbox plugin routing and portalled message-menu dismissal // must focus the same native decorated editor and preserve its reply draft. @@ -44,6 +45,13 @@ test("Inbox edits an owned reply in place and restores the reply draft", async ( const own = app.reply(root.id, true); const row = detail.locator(`[data-message-id="${own.id}"]`); await expect(row).toBeVisible(); + // Opening the conversation reveals its entry reply by focusing that row. In + // WebKit the focus clears the editor selection, so a fill racing the reveal + // types nothing: let the focus and its next-frame acknowledgement land first. + await expect( + detail.locator('[data-message-id][tabindex="-1"]'), + ).toBeFocused(); + await frames(page); await reply.fill("Unsent Inbox reply"); const originalNode = await reply.elementHandle(); const edit = async () => {