-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Block Editor: Refactor ResponsiveBlockControl
tests to use @testing-library/react
#44669
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
Conversation
Size Change: 0 B Total Size: 1.27 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.
A good follow-up for this component's tests would be to refactor all queries to use screen rather than querySelector and querySelectorAll.
I agree that would be a nice follow, but considering that component isn't used in core, this is a low priority.
P.S. The component probably needs refactoring with updated spacing controls.
What?
This PR refactors the tests of
ResponsiveBlockControl
to use@testing-library/react
's render instead ofreact-dom
render. This addresses one of the changes needed to upgrade to React 18, as touched in #32765.Why?
This addresses one of the changes needed to upgrade to React 18, as touched in #32765.
How?
We're just using the
@testing-library/react
render method and updating a few utilities, but another special.A good follow-up for this component's tests would be to refactor all queries to use
screen
rather thanquerySelector
andquerySelectorAll
.Testing Instructions
Verify tests still pass:
npm run test:unit packages/block-editor/src/components/responsive-block-control/test/index.js