-
-
Notifications
You must be signed in to change notification settings - Fork 707
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
Capture initial resize event #2552
Capture initial resize event #2552
Conversation
Seems like our unit tests are covering is 😀 |
Updated the unit test to observe twice |
// Call twice, because the initial "observe" event fired by ResizeObserver | ||
// is muted in the map constructor | ||
|
||
observerCallback(); |
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.
Can you add another test or and expectations between the first and second callback?
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.
Great idea, I added these so it now says:
// The initial "observe" event fired by ResizeObserver should be captured/muted
// in the map constructor
observerCallback();
expect(spyA).not.toHaveBeenCalled();
expect(spyB).not.toHaveBeenCalled();
// Following "observe" events should fire a resize / _update
observerCallback();
expect(spyA).toHaveBeenCalled();
expect(spyB).toHaveBeenCalled();
```
Closes #2551
Captures the initial resize event from the resize observer, so it's more similar to the previous implementation that didn't fire on setup.
Adds the browser test that checks that the 'load' event comes before 'resize' and 'moveend'
Launch Checklist