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 <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-09 06:20:07 -05:00
1 parent 30d57b2971
commit 7d0a36d393
1 file changed
+7 -2
+7 -2
View File
@@ -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);