-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[test] disable animations in unit testing #16288
base: master
Are you sure you want to change the base?
[test] disable animations in unit testing #16288
Conversation
Deploy preview: https://deploy-preview-16288--material-ui-x.netlify.app/ |
@@ -1,3 +1,5 @@ | |||
import * as React from 'react'; |
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.
import * as React from 'react'; |
@lauri865 @mui/xgrid WDYT about the updated approach of https://reactcommunity.org/react-transition-group/testing/? 🤔 |
Ah, nice find! Seems to break less tests it seems as well. Wonder why they suggested an alternative approach here? 🤔 |
I am not sure; maybe they are suggesting going for maximum efficiency and completely mocking the module to avoid any potential overhead. |
I'm not insinuating it's better. I found it difficult to fake the components due to some state being dependent on transition life-cycle events, hence I overrode props instead. Are you use the latest one works? Transition component children are functions in many instances, and this should error out ("functions are not valid children" yaddayadda). mui-x/test/utils/mochaHooks.js Line 24 in 583b078
If the config prop works, I think it's probably the best bet. |
An experiment to remove transitions from unit tests in order to make tests more stable. Lots of tests breaking due to
act
errors, which more often than not are related to theTransition
component ofreact-transition-group
. Would be good to disable it globally, and get rid of unnecessarywaitFor
calls as a result to make testing faster as well as more stable.I don't have more time to dig into this now, so will leave it at this, if anyone wants to explore it further. Some tests broke as a result.