From fbc13584cea4d160134a96d9b88dfa0e06c50d8c Mon Sep 17 00:00:00 2001 From: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:00:44 -0800 Subject: [PATCH] test(web): stabilize scrolling and project selection checks --- .../chat/MessagesTimeline.browser.test.tsx | 10 ++++++++++ .../AcpSessionManagementSection.browser.test.tsx | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx index 26b3b80a3c49b..44c40bd70e2e9 100644 --- a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx @@ -261,6 +261,16 @@ describe("MessagesTimeline work rows", () => { }); it("keeps following a streaming turn after a heading is expanded at the bottom", async () => { + const session = cdp(); + // Exercise end-follow independently of smooth-scroll animation timing. + await session.send("Emulation.setEmulatedMedia", { + features: [{ name: "prefers-reduced-motion", value: "reduce" }], + }); + await using _media = { + [Symbol.asyncDispose]: async () => { + await session.send("Emulation.setEmulatedMedia", { features: [] }); + }, + }; const props = { ...baseProps(), isWorking: true }; const runId = RunId.make("live-run"); const container = document.createElement("div"); diff --git a/apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx b/apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx index 824d4a28f99a1..60289f874ce0f 100644 --- a/apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx +++ b/apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx @@ -282,8 +282,16 @@ it.each([true, false])( }); await using screen = await renderSection({ canList, projects: [project, second] }); await screen.getByRole("combobox").click(); - if (canList) await userEvent.keyboard("{ArrowDown}{Enter}"); - else await screen.getByRole("option", { name: "Second", exact: true }).click(); + if (canList) { + await expect + .element(screen.getByRole("option", { name: project.title, exact: true })) + .toHaveFocus(); + await userEvent.keyboard("{ArrowDown}"); + await expect + .element(screen.getByRole("option", { name: "Second", exact: true })) + .toHaveFocus(); + await userEvent.keyboard("{Enter}"); + } else await screen.getByRole("option", { name: "Second", exact: true }).click(); await expect .element( screen.getByRole("combobox", {