From ae03023d7291d35a07364a2228e175658efc21ab Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:10:40 +0000 Subject: [PATCH] fix(test): wait for sidebar fade-in to complete in overlay-layers test Explicitly wait for the `#sidebar` element to lose the `fade-in` class after dismissing the disclaimer modal in `tests/visual/overlay-layers.spec.ts`. This prevents race conditions in CI environments where the `opacity: 0` style from the fade-in animation persists during subsequent visibility checks, causing `expect(locator).toBeVisible()` to fail unexpectedly. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/visual/overlay-layers.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/visual/overlay-layers.spec.ts b/tests/visual/overlay-layers.spec.ts index 8de3cb9a..3d98a3e1 100644 --- a/tests/visual/overlay-layers.spec.ts +++ b/tests/visual/overlay-layers.spec.ts @@ -45,6 +45,11 @@ test.describe("overlay layering tokens", () => { await dismissDisclaimerModal(page); + // Wait for initial fade-in to complete so opacity doesn't interfere with visibility checks + await page.waitForFunction( + () => !document.getElementById("sidebar")?.classList.contains("fade-in") + ); + await expect(page.locator("#mobileMenuBtn")).toHaveCount(0); const collapseToggle = page.locator("#sidebarCollapseToggle");