Skip to content

Commit 5bcc90e

Browse files
authored
test(web): fix release browser test failures (#22508)
1 parent ca140c4 commit 5bcc90e

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,19 @@ it("keeps only the usage limit attached while an active goal waits in the collap
7777
const limit = page.getByText("Usage limit reached", { exact: true });
7878
const goal = page.getByText("Goal active", { exact: true });
7979

80-
expect(visibleBanners()).toHaveLength(1);
80+
// A retained pointer can expand the stack as it mounts; start outside the hover target.
81+
await userEvent.hover(limit);
82+
await expect.poll(visibleBanners).toHaveLength(1);
8183
await expect.element(limit).toBeVisible();
8284
await expect.element(goal).not.toBeVisible();
8385
expect(container.querySelector('[data-slot="composer-banner-attachment"]')?.textContent).toBe(
8486
"Usage limit reached",
8587
);
8688

87-
await page.getByRole("button", { name: "Show other notices" }).click();
89+
const peek = page.getByRole("button", { name: "Show other notices" });
90+
// Hover opens the stack and hides the peek before a pointer click can finish.
91+
await act(() => peek.element().focus());
92+
await userEvent.keyboard("{Enter}");
8893
await expect.element(goal).toBeVisible();
8994
await expect.element(limit).toBeVisible();
9095
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
9398
await expect.element(goal).not.toBeVisible();
9499
await expect.element(limit).toBeVisible();
95100
expect(visibleBanners()).toHaveLength(1);
101+
102+
await userEvent.hover(peek);
103+
await expect.element(goal).toBeVisible();
104+
await expect.element(limit).toBeVisible();
105+
await expect.poll(visibleBanners).toHaveLength(2);
96106
});
97107

98108
it("reveals the full running command only while its title is clipped", async () => {

‎apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ describe("code-view worker lifecycle", () => {
200200
};
201201
}
202202

203-
it("starts on demand, keeps quick reopens warm, and expires the last closed pool", async () => {
203+
// Two cold starts can each use Pierre's 10-second initialization budget.
204+
it("starts workers on demand and expires idle pools", { timeout: 30_000 }, async () => {
204205
setup();
205206
await using workers = await workerEnvironment();
206207
const view = await workers.render(renderViews(0));

‎apps/web/src/components/pullRequest/PullRequestDetailPanel.browser.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,15 @@ describe.each([
398398
);
399399
});
400400

401+
// The first Code-tab action starts real diff workers as well as driving the panel.
401402
it.each([
402403
"Resolve conflicts",
403404
"Ask a question",
404405
"Explain this PR",
405406
"Fix findings in this thread",
406407
"Fix check",
407408
"Add to agent",
408-
])("%s writes to the correct composer", async (action) => {
409+
])("%s writes to the correct composer", { timeout: 30_000 }, async (action) => {
409410
setup();
410411
// Cover both a host without inline comments and an account that cannot write them.
411412
currentDetail =

0 commit comments

Comments
 (0)