From 7d0a36d393da13226951df6269ca2ed26b6322c8 Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 9 Oct 2026 06:19:01 -0500 Subject: [PATCH] test(ui): dismiss late announcements during company navigation Retry the normal Agents link within a bounded deadline and use the ordinary dismissal control if the asynchronously loaded announcement covers it. Preserve the company-isolation and history assertions. Co-Authored-By: Paperclip --- tests/e2e/chat-adapters-ui-messaging.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/e2e/chat-adapters-ui-messaging.spec.ts b/tests/e2e/chat-adapters-ui-messaging.spec.ts index 9a73e722a2..685133dbc6 100644 --- a/tests/e2e/chat-adapters-ui-messaging.spec.ts +++ b/tests/e2e/chat-adapters-ui-messaging.spec.ts @@ -1364,8 +1364,13 @@ test.describe("Exact failed chat run retry", () => { afterSwitchSelectedCompany: await page.evaluate(() => localStorage.getItem("paperclip.selectedCompanyId")), }, null, 2)); await expect(page).toHaveURL(new RegExp(`/${seed.prefix}/dashboard$`)); - if (await dismissAnnouncement.isVisible()) await dismissAnnouncement.click(); - await page.getByRole("link", { name: "Agents", exact: true }).first().click(); + // The announcement waits for its feed and a settle timer. It can appear + // after the dashboard URL settles, while the sidebar click is retrying. + // Dismiss it through the normal control when it actually blocks the link. + await expect(async () => { + if (await dismissAnnouncement.isVisible()) await dismissAnnouncement.click(); + await page.getByRole("link", { name: "Agents", exact: true }).first().click({ timeout: 1_000 }); + }).toPass({ timeout: 10_000 }); await page.getByRole("link", { name: "Maya", exact: true }).first().click(); await expect(page).toHaveURL(new RegExp(`/${seed.prefix}/agents/maya(?:/overview)?$`)); await expect(page.getByText(foreignTitle, { exact: true })).toHaveCount(0);