Skip to content

Commit d8e27c7

Browse files
committed
test(ui): bind managed-image polling to its test context
Trace the full-file failure to overlapping completion of the narrow-image case: Vitest clears its ambient current-test slot while the tiny-image case awaits hover, so global expect.poll loses its owner. The reduced pair fails before this fix while isolation and serial execution pass. Use context.expect for both polls, preserving every assertion, timeout, and concurrent scheduling. The image test originated in #131811; thanks @vyctorbrzezowski for the managed-image coverage.
1 parent bb51e90 commit d8e27c7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎ui/src/pages/chat/chat-responsive.browser.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,9 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
22772277
}
22782278
});
22792279

2280-
it("keeps managed image actions anchored around tiny rendered images", async () => {
2280+
// Concurrent siblings clear Vitest's ambient test when they finish. Bind polls
2281+
// to this test so an awaited hover cannot lose its assertion context.
2282+
it("keeps managed image actions anchored around tiny rendered images", async (context) => {
22812283
const page = await openBrowserPage(1280, 900);
22822284
try {
22832285
await page.setContent(
@@ -2317,7 +2319,7 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
23172319
</body></html>`,
23182320
);
23192321
const frames = page.locator(".chat-image-frame--managed");
2320-
await expect.poll(() => frames.count()).toBe(2);
2322+
await context.expect.poll(() => frames.count()).toBe(2);
23212323
const frameRows = await frames.evaluateAll((elements) =>
23222324
elements.map((element) => {
23232325
const box = element.getBoundingClientRect();
@@ -2328,7 +2330,7 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
23282330
for (const [index, expectedWidth] of [160, 84].entries()) {
23292331
const frame = frames.nth(index);
23302332
await frame.hover();
2331-
await expect
2333+
await context.expect
23322334
.poll(() => frame.evaluate((element) => getComputedStyle(element, "::after").opacity))
23332335
.toBe("1");
23342336
const geometry = await frame.evaluate((element) => {

0 commit comments

Comments
 (0)