From ed6721f6dc0b573b7b38b85e245ef9ee9bbd5576 Mon Sep 17 00:00:00 2001 From: dsh-ci-bot Date: Thu, 12 Nov 2026 05:44:38 +0800 Subject: [PATCH] test(web): let the sampled fold transition settle before the next posture change assertFoldResize finishes the sampled grid-template-columns transition from the page side; CSS delivers the matching transitionend in a later rendering update. The sidebar-drawer e2e then changes the posture again. When that end event arrives after the new window is armed, AppFrame's settle handler drops data-animating and cancels the new transition, so the next assertFoldResize poll never sees a running transition (master CI runs 43002182954 and 43076752328 failed at apps/web/tests/sidebar-drawer.e2e.ts:500). Give the frame a rendering update and wait for data-animating to clear at the end of the helper, so the next step starts from a settled frame. --- apps/web/tests/sidebar-drawer.e2e.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps/web/tests/sidebar-drawer.e2e.ts b/apps/web/tests/sidebar-drawer.e2e.ts index 99b5c3fd43..b8768155bb 100644 --- a/apps/web/tests/sidebar-drawer.e2e.ts +++ b/apps/web/tests/sidebar-drawer.e2e.ts @@ -216,6 +216,28 @@ async function assertFoldResize(toggle: Locator, from: number, to: number): Prom expect(sample.middle.width).toBeGreaterThan(Math.min(from, to)) expect(sample.middle.width).toBeLessThan(Math.max(from, to)) expect(sample.middle.gap).toBeCloseTo(sample.start.gap, 1) + // The sample above finishes this track transition from the page side, and CSS + // delivers the matching transitionend in a later rendering update. Give it that + // update and wait for the frame to settle before the caller changes the layout + // again: an end event from this sample delivered after the next toggle would + // settle the new window, drop data-animating and cancel the transition the next + // assertFoldResize looks for. + await toggle.evaluate(() => new Promise((resolve) => { + let frames = 0 + const tick = () => { + frames += 1 + if (frames >= 2) resolve() + else requestAnimationFrame(tick) + } + requestAnimationFrame(tick) + // A hidden or throttled page may withhold animation frames; the settle poll below + // still covers that case through AppFrame's own 600ms fallback. + setTimeout(resolve, 2_000) + })) + await expect.poll( + () => toggle.evaluate(button => button.closest('[data-animating]') === null), + { timeout: 5_000 }, + ).toBe(true) } it('overlays the conversation and closes after navigation without losing its sidebar content', async () => {