-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
1.4.1 Texfield multiline jest snapshot tests broken #12247
Comments
@sakulstra I have removed some defensive checks that looks very much like dead code to me in #12238 and #12239. I doubt the root of the issue is on Material-UI. The component can be mounted just fine on a browser environment. |
I am having this issue as well. The issue is caused by the Our snapshot tests use Jest/Enzyme to do shallow rendering, which means child components are not mounted so the refs are |
@kanzelm3 This error comes from the |
Are you OK closing the issue for enzymejs/enzyme#1411? |
@oliviertassinari I thought about disabling lifecycle methods. The problem I'm facing with that is we depend on the lifecycle methods to perform functional testing on a few of our components. Because we use |
@kanzelm3 With the information I have at hand, I deeply think it's an enzyme issue, but let's make the life easier for everybody. I think that we should be adding the defensive branch logic back 😢 (with a comment this time). |
When upgrading to 1.4.1 all our snapshot tests including a
<TextField multiline />
are broken due toError: Uncaught [TypeError: Cannot read property 'scrollHeight' of null]
.We had similar issues in the past which were related to refs + react-test-renderer, but I couldn't spot any change in 1.4.1 yet which changed the ref logic.
Cannot read property 'scrollHeight' of null
#5531Expected Behavior
minor version jump shouldn't break testing setup
Current Behavior
testing setup is broken
Steps to Reproduce
Snapshot
<TextField multiline {...props} />
via jest.Context
We render snapshots of all our pages to spot changes on component updates.
Your Environment
The text was updated successfully, but these errors were encountered: