Fix/cypress resizeobserver mock#11193
Open
AarishMansur wants to merge 2 commits intomarmelab:nextfrom
Open
Conversation
54e66ab to
03da508
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cypress tests trigger the browser error:
ResizeObserverloop completed with undelivered notificationsThis happens when components using
ResizeObservercause repeated resize cycles in the Cypress environment.The current workaround suppresses this error using
Cypress.on('uncaught:exception'). While this prevents test failures, it hides real issues and reduces the reliability of the test suite.Solution
Replaced the error suppression workaround with a proper
ResizeObservermock.Added a dedicated
ResizeObserverMockutility that:ResizeObserverinterface (observe,unobserve,disconnect)requestAnimationFrameto avoid loopscontentRectvalues viagetBoundingClientRectInjected the mock using
Cypress.on('window:before:load')so it is available before the application initializesRemoved the
uncaught:exceptionhandler that was previously ignoring the errorUpdated Cypress TypeScript configuration to properly support
.jsfiles and prevent emit conflictsThis ensures stable test execution while keeping error reporting accurate.
How To Test
Run Cypress tests:
Verify:
ResizeObserver loop completed...errors appearuncaught:exceptionsuppression is presentAdditional Checks
masterfor a bugfix or a documentation fix, ornextfor a featureFixes : #10649