From 4424db22cb6a5f198f0e73255c36d49f9f14ce4b Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 11 May 2026 02:38:06 +0200 Subject: [PATCH] fix(cypress): allow scrollTo on non-scrollable pages in footer dropup test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cy.scrollTo('bottom') threw on CI ("element is not scrollable") whenever the rendered page fit inside the viewport. Pass ensureScrollable:false so the call is a no-op on short pages — the footer is already in view and the subsequent rect-position pre-check enforces the actual precondition that chooseDirection() needs. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/cypress/e2e/menu.spec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/cypress/e2e/menu.spec.js b/app/cypress/e2e/menu.spec.js index 080d0d8..53fddcc 100644 --- a/app/cypress/e2e/menu.spec.js +++ b/app/cypress/e2e/menu.spec.js @@ -46,11 +46,12 @@ describe('Navigation dropdowns', () => { .as('menu') .should('not.have.class', 'show'); - // Scroll the page so the footer sits at the bottom of the viewport, - // then click without Cypress re-scrolling — otherwise the toggle could - // land near the top of the viewport and chooseDirection would keep - // .dropdown (more space below than above). - cy.scrollTo('bottom'); + // Make sure the footer sits at the bottom of the viewport before clicking + // — otherwise the toggle could land near the top and chooseDirection would + // keep .dropdown (more space below than above). + // ensureScrollable:false because on short pages the body isn't scrollable + // and the footer is already in view (which is fine for this test). + cy.scrollTo('bottom', { ensureScrollable: false }); cy.get('@toggle').then($toggle => { const rect = $toggle[0].getBoundingClientRect(); expect(rect.top, 'toggle is in the lower half of the viewport')