fix(frontend,e2e): stop Cypress flakes from #mount scroll - #1054
Conversation
…akes body is overflow:hidden and #mount is the real scroll container, so window.scrollTo(0,0) was a no-op. That left search/browse headings clipped and made smoke.cy.js "home search" flake on main. Add scrollMountToTop(), use it on page mounts, and harden e2e heading asserts with scrollIntoView while keeping the seed fixture contract (Mutually authenticate / V13.2.5).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Summary by CodeRabbit
WalkthroughThe PR adds a shared scroll-reset helper for the ChangesSPA scroll reset
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Navigation now resets the application’s actual scroll container, preventing pages from opening mid-scroll and stabilizing relevant visibility checks. The change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
application/frontend/src/pages/BrowseRootCres/browseRootCres.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsxESLint skipped: the matched ESLint configuration already failed (missing-dependency). application/frontend/src/pages/Graph/Graph.tsxESLint skipped: the matched ESLint configuration already failed (missing-dependency).
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Test-e2efailures onmain:smoke.cy.js→home search routes to search results pagetimes out becauseh1.standard-page__heading("Results matching") is clipped by#mount(overflow-y: auto).bodyisoverflow: hidden, sowindow.scrollTo(0, 0)in page mounts was a no-op.scrollMountToTop()and use it on Search / Root CREs / CRE / Standard / Graph mounts (same pattern Docs already documents).scrollIntoView.scripts/seed_e2e_fixtures.pycontract (Mutually authenticate, ASVS/V13.2.5). Do not swap root CRE asserts toCryptography(that CRE is the free-text search fixture only).Why not #1050 as-is
#1050 correctly noticed the scrollIntoView need, but also:
Mutually authenticatewithCryptography(wrong fixture role).standard.cy.jsdata-bearing asserts — those were already passing on main.Supersedes #1050.
Test plan
home search+ clippedstandard-page__headingTest-e2egreen on this PRmake frontend/ lint as required by CIMade with Cursor