-
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
Nux: Improve act()
usage in DotTip
tests
#46231
Conversation
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
@@ -5,7 +5,7 @@ exports[`DotTip should render correctly 1`] = ` | |||
aria-label="Editor tips" | |||
class="components-popover nux-dot-tip" | |||
role="dialog" | |||
style="position: absolute; opacity: 0; transform: translateX(-2em) scale(0) translateZ(0); transform-origin: 0% 50% 0; left: 0px; top: 0px;" | |||
style="position: absolute; opacity: 0.9994144868675858; transform: translateX(-0.00117em) scale(0.9994144868675858) translateZ(0); transform-origin: 0% 50% 0; left: 0px; top: 0px;" |
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 think we can just skip the whole test suite for the NUX package. It's been deprecated and has no longer been maintained since WP 5.4. Riad has proposed removing the package as well. See #46110. |
As recognized, there are some flaws with this approach, it's not reliable enough to check if a popover is positioned the way we do. I'll reconsider the approach in another PR. |
What?
This PR improves the
act()
usage inDotTip
to make the tests more precise and expressive.Why?
As part of the React 18 upgrade in #45235, we added a bunch of
act()
calls that could be improved and made more specific.How?
Instead of going with
await act( () => Promise.resolve() )
, we change the test to wait for the dialog to be positioned before continuing.Testing Instructions
Verify tests still pass:
npm run test:unit packages/nux/src/components/dot-tip/test/index.js
Testing Instructions for Keyboard
None
Screenshots or screencast
None