Skip to content
TypeScript

test(web): fix release browser test failures (#22508)

Theo Browne5bcc90e1116e
diff --git a/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx b/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
index 01a1ed13fdc..757f3db20c0 100644
--- a/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
+++ b/apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
@@ -77,14 +77,19 @@ it("keeps only the usage limit attached while an active goal waits in the collap
const limit = page.getByText("Usage limit reached", { exact: true });
const goal = page.getByText("Goal active", { exact: true });
- expect(visibleBanners()).toHaveLength(1);
+ // A retained pointer can expand the stack as it mounts; start outside the hover target.
+ await userEvent.hover(limit);
+ await expect.poll(visibleBanners).toHaveLength(1);
await expect.element(limit).toBeVisible();
await expect.element(goal).not.toBeVisible();
expect(container.querySelector('[data-slot="composer-banner-attachment"]')?.textContent).toBe(
"Usage limit reached",
);
- await page.getByRole("button", { name: "Show other notices" }).click();
+ const peek = page.getByRole("button", { name: "Show other notices" });
+ // Hover opens the stack and hides the peek before a pointer click can finish.
+ await act(() => peek.element().focus());
+ await userEvent.keyboard("{Enter}");
await expect.element(goal).toBeVisible();
await expect.element(limit).toBeVisible();
await expect.poll(visibleBanners).toHaveLength(2);
@@ -93,6 +98,11 @@ it("keeps only the usage limit attached while an active goal waits in the collap
await expect.element(goal).not.toBeVisible();
await expect.element(limit).toBeVisible();
expect(visibleBanners()).toHaveLength(1);
+
+ await userEvent.hover(peek);
+ await expect.element(goal).toBeVisible();
+ await expect.element(limit).toBeVisible();
+ await expect.poll(visibleBanners).toHaveLength(2);
});
it("reveals the full running command only while its title is clipped", async () => {
diff --git a/apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx b/apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx
index 8fbd98a3586..71dd1e89ee4 100644
--- a/apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx
+++ b/apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx
@@ -200,7 +200,8 @@ describe("code-view worker lifecycle", () => {
};
}
- it("starts on demand, keeps quick reopens warm, and expires the last closed pool", async () => {
+ // Two cold starts can each use Pierre's 10-second initialization budget.
+ it("starts workers on demand and expires idle pools", { timeout: 30_000 }, async () => {
setup();
await using workers = await workerEnvironment();
const view = await workers.render(renderViews(0));
diff --git a/apps/web/src/components/pullRequest/PullRequestDetailPanel.browser.test.tsx b/apps/web/src/components/pullRequest/PullRequestDetailPanel.browser.test.tsx
index 323297b7309..24e2a1955ee 100644
--- a/apps/web/src/components/pullRequest/PullRequestDetailPanel.browser.test.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestDetailPanel.browser.test.tsx
@@ -398,6 +398,7 @@ describe.each([
);
});
+ // The first Code-tab action starts real diff workers as well as driving the panel.
it.each([
"Resolve conflicts",
"Ask a question",
@@ -405,7 +406,7 @@ describe.each([
"Fix findings in this thread",
"Fix check",
"Add to agent",
- ])("%s writes to the correct composer", async (action) => {
+ ])("%s writes to the correct composer", { timeout: 30_000 }, async (action) => {
setup();
// Cover both a host without inline comments and an account that cannot write them.
currentDetail =