Skip to content
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] Migrate more components to react-testing-library #22874

Merged
merged 8 commits into from Oct 5, 2020
Merged

[test] Migrate more components to react-testing-library #22874

merged 8 commits into from Oct 5, 2020

Conversation

baterson
Copy link
Contributor

@baterson baterson commented Oct 4, 2020

Replaces enzyme for react-testing-library in the <HiddenJs/> and <HiddenCss/>

#22911

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 4, 2020

No bundle size changes comparing 4824c9e...e77b20e

Generated by 🚫 dangerJS against e77b20e

@baterson
Copy link
Contributor Author

baterson commented Oct 4, 2020

I don't know how to test these cases in <Hidden />
https://github.com/mui-org/material-ui/blob/b3d431a0ff1389c8924343925be753dff1b81600/packages/material-ui/src/Hidden/Hidden.test.js#L15-L23

Since we can't check which children type was rendered using react-testing-library Could you give me a tip, please?

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the test of the implementation prop, we could either drop the assertion or test the DOM structure. CSS requires a wrapping <div> element which JS doesn't.

packages/material-ui/src/Hidden/HiddenCss.test.js Outdated Show resolved Hide resolved
@oliviertassinari oliviertassinari changed the title [test] Migrate more components to react-testing-library #22872 [test] Migrate components to react-testing-library Oct 4, 2020
@oliviertassinari oliviertassinari changed the title [test] Migrate components to react-testing-library [test] Migrate more components to react-testing-library Oct 4, 2020
@oliviertassinari oliviertassinari merged commit 9a2f4d9 into mui:next Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants