-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ResizeObserver polyfill globally in Jest tests #173772
Add ResizeObserver polyfill globally in Jest tests #173772
Conversation
5b45013
to
9b34fc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synthetics changes look good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloud_defend and session_viewer changes lgtm
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
## Summary This PR adds the ResizeObserver polyfill in Jest Tests reusing a polyfill already used in Kibana. The PR also removes all the mocks for the ResizeObserver used in tests. The polyfill is no longer needed in code running on a browser as the [ResizeObserver API is already available](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility) in every Kibana-supported browser. There is still one last polyfill to remove `@juggle/resize-observer` but this is used internally by the `use-resize-observer` hook. A following PR could probably replace that hook with a different hook that doesn't require that polyfill to cleanup a bit our dependencies
Summary
This PR adds the ResizeObserver polyfill in Jest Tests reusing a polyfill already used in Kibana.
The PR also removes all the mocks for the ResizeObserver used in tests.
The polyfill is no longer needed in code running on a browser as the ResizeObserver API is already available in every Kibana supported browser.
There is still one last polyfill to remove
@juggle/resize-observer
but this is used internally by theuse-resize-observer
hook. A following PR could probably replace that hook with a different hook that doesn't require that polyfill to cleanup a bit our dependencies