Skip to content

Commit ff562f6

Browse files
Merge pull request #101 from ScriptedAlchemy/fix/browser-test-synchronization
test(web): stabilize scrolling and project selection checks
2 parents 155f759 + fbc1358 commit ff562f6

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎apps/web/src/components/chat/MessagesTimeline.browser.test.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,16 @@ describe("MessagesTimeline work rows", () => {
261261
});
262262

263263
it("keeps following a streaming turn after a heading is expanded at the bottom", async () => {
264+
const session = cdp();
265+
// Exercise end-follow independently of smooth-scroll animation timing.
266+
await session.send("Emulation.setEmulatedMedia", {
267+
features: [{ name: "prefers-reduced-motion", value: "reduce" }],
268+
});
269+
await using _media = {
270+
[Symbol.asyncDispose]: async () => {
271+
await session.send("Emulation.setEmulatedMedia", { features: [] });
272+
},
273+
};
264274
const props = { ...baseProps(), isWorking: true };
265275
const runId = RunId.make("live-run");
266276
const container = document.createElement("div");

‎apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,16 @@ it.each([true, false])(
282282
});
283283
await using screen = await renderSection({ canList, projects: [project, second] });
284284
await screen.getByRole("combobox").click();
285-
if (canList) await userEvent.keyboard("{ArrowDown}{Enter}");
286-
else await screen.getByRole("option", { name: "Second", exact: true }).click();
285+
if (canList) {
286+
await expect
287+
.element(screen.getByRole("option", { name: project.title, exact: true }))
288+
.toHaveFocus();
289+
await userEvent.keyboard("{ArrowDown}");
290+
await expect
291+
.element(screen.getByRole("option", { name: "Second", exact: true }))
292+
.toHaveFocus();
293+
await userEvent.keyboard("{Enter}");
294+
} else await screen.getByRole("option", { name: "Second", exact: true }).click();
287295
await expect
288296
.element(
289297
screen.getByRole("combobox", {

0 commit comments

Comments
 (0)