From b639914ecd55bc62631632933f623d96c0b2e87d Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 11 Sep 2026 16:50:35 -0500 Subject: [PATCH] test: await chat connection creation after agent selection Co-Authored-By: Paperclip --- tests/e2e/chat-adapters-ui.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/chat-adapters-ui.spec.ts b/tests/e2e/chat-adapters-ui.spec.ts index 77b403e06e..11bfec92a6 100644 --- a/tests/e2e/chat-adapters-ui.spec.ts +++ b/tests/e2e/chat-adapters-ui.spec.ts @@ -1531,7 +1531,8 @@ test.describe.serial("native chat adapter UI", () => { ).toBeVisible(); await expectSetupRail(page); await selectMaya(page); - expect(mock.createdWithAgentId).toBe(seed.agentId); + // The selection schedules a request; clicking alone does not await it. + await expect.poll(() => mock.createdWithAgentId).toBe(seed.agentId); expect(mock.createdWithAgentId).not.toBe(seed.otherAgentId); await expect( page.getByRole("button", { name: "Choose an active agent" }),