-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[test] Remove test-only class wrappers for higher-order components #15017
[test] Remove test-only class wrappers for higher-order components #15017
Conversation
@material-ui/styles: parsed: -2.36% 😍, gzip: -1.83% 😍 Details of bundle changes.Comparing: f9896bc...0e661ba
|
Don't know why the bounding box of the ref element changed in the browser 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.
Awesome, does it mean we can remove the custom withTheme implementation too?
Should be covered. Description was just incomplete. |
@@ -72,7 +72,7 @@ describe('<MenuList />', () => { | |||
assert.strictEqual(list.style.paddingLeft, ''); | |||
assert.strictEqual(list.style.width, ''); | |||
menuListActionsRef.current.adjustStyleForScrollbar( | |||
{ clientHeight: 10 }, | |||
{ clientHeight: 20 }, |
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.
/cc @ryancogswell
Not entirely sure why. I think it has something to do with ref
now being attached to the actual host component instead of the class wrapper. Without this change browser test were failing: https://circleci.com/gh/mui-org/material-ui/79900
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.
Prior to the change, no CSS was injected in the page, now, it is. I have already seen this behavior in the past. The newly injected CSS change the layout values, now, they are correct.
The new styles come from the List component.
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 the change even better I suppose.
I merge so we can move #14965 (comment) and #14958 forward. |
Class wrappers for certain higher-order components were required before facebook/react#15100.
There is still a bug in
enzyme
that preventsstate()
usage butinstance().state
should be equivalent.state()
probably has some additional guards for older component patterns.