michael-s-molina commented on a change in pull request #15399:
URL: https://github.com/apache/superset/pull/15399#discussion_r660494906
##########
File path:
superset-frontend/spec/javascripts/explore/components/VizTypeControl_spec.jsx
##########
@@ -31,6 +33,9 @@ const defaultProps = {
isModalOpenInit: true,
};
+const waitForEffects = () =>
+ act(() => new Promise(resolve => setTimeout(resolve, 0)));
Review comment:
Actually, the recommended way here is to use `findBy` and `awaitFor` to
deal with these situations. The `render` of RTL is [already
wrapped](https://javascript.plainenglish.io/you-probably-dont-need-act-in-your-react-tests-2a0bcd2ad65c)
in `act`.
Another point is to try to avoid
[nesting](https://kentcdodds.com/blog/avoid-nesting-when-youre-testing) in your
tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]