-
Notifications
You must be signed in to change notification settings - Fork 4.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
Block Editor: Make URLPopover
tests more precise
#46654
Conversation
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
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.
Makes sense 👍
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.
👍
* @param {HTMLElement} element Element to start with. | ||
* @return {HTMLElement|null} Popover element, or `null` if not found. | ||
*/ | ||
function getWrappingPopoverElement( element ) { |
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.
Maybe it's time to finally extract this to some common helper? 🙂
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.
I agree 👍
3973d53
to
a302495
Compare
What?
This PR updates the
URLPopover
tests to actually wait for the popover to be positioned, instead of waiting for the next event loop tick.Why?
This makes the test more comprehensible as it clearly expresses the intention of waiting until the popover has already been positioned.
How?
We're using the
toBePositionedPopover
matcher that we've been using for other tests.Testing Instructions
Verify tests pass:
npm run test:unit packages/block-editor/src/components/url-popover/test/index.js