-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Use resizeObserver instead of window resize events, fix and clean tests #2157
Conversation
This is strange... Why would only a small part of the render test fail? Why are they affected from the resize mechanism change? |
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.
Looks good to me in general, thanks! I think since the behavior for resizing containers has changes, we should treat this as a breaking change with associated changelog remark. Please also add a test where you only resize the map container but not the window.
The unit tests are covering the resize functionality without knowing if the window or the container were resized. |
Ah OK I thought the test simulate resizing of the window and then check that our code gets called. But if the tests already resizing from container, we do not need more tests. |
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.
Looking forward to use this new behavior. Thanks!
I added 2 browser tests, just in case... |
maplibre change log https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#310 Breaking changes that required fixes * 3.0.0 Remove "mapbox-gl-supported" package from API. If needed, please reference it directly instead of going through MapLibre. (maplibre/maplibre-gl-js#2451) * 3.0.0 Resize map when container element is resized. The "resize"-related events now has different data associated with it (maplibre/maplibre-gl-js#2157, maplibre/maplibre-gl-js#2551). Previously the originalEvent field was the reason of this change, for example it could be a resize event from the browser. Now it is ResizeObserverEntry, see more [here](https://developer.mozilla.org/en-US/docs/web/api/resizeobserverentry). * 2.2.0 Improve filter specification typings (maplibre/maplibre-gl-js#1390) --------- Co-authored-by: Kibana Machine <[email protected]>
This adds the relevant unit test.
Cleans the other tests that has duplicate code in every before function.
Clear some test that did not need some methods.
@rotu Feel free to review :-)
Replaces #2013