You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First - Thank you very much, you are doing amazing work!
Bug report:
What is the current behavior?
I'm using TestUtils from react-dom/test-utils
After rendering a component tree that contains a connected component, the connected component instance can't be found with TestUtils.findRenderedComponentWithType
// someWrapper is an instance that was rendered with ReactDOM.render. It renders the connected MyComp in its render method
// method
const myCompInstance = TestUtils.findRenderedComponentWithType(someWrapper, MyComp)
// fails with Error: Did not find exactly one match (found: 0) for componentType:[object Object]
const myCompInnerInstance = TestUtils.findRenderedComponentWithType(someWrapper, MyCompInner)
// works ok
Please let me know if you need the full code example or this is enough to understand.
What is the expected behavior?
It should be possible to find the connected component instance, not just the inner component instance, as it was in previous versions.
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
The tests run in node, with jest (standard CRA project)
I've just upgraded react-redux from 5.0.7 to 7.0.2 and this started happening
I'm using version react and react-dom version 16.8.4
The text was updated successfully, but these errors were encountered:
See facebook/react#13455. The basic recommendation is not to use test-utils with these newer kinds of object elements (React.memo, forwardRef, etc). You should switch to using react-testing-library.
Thanks you @timdorr.
I see now this issue isn't related to react-redux. I do believe React team should provide a solution for this - some basic way to traverse the tree.
I'll check react-testing-library, but at first glance it seems problematic, since the API is synchronous and React rendering isn't (at least not guaranteed to be).
First - Thank you very much, you are doing amazing work!
Bug report:
What is the current behavior?
I'm using TestUtils from react-dom/test-utils
After rendering a component tree that contains a connected component, the connected component instance can't be found with TestUtils.findRenderedComponentWithType
Example -
In my component
In the test
Please let me know if you need the full code example or this is enough to understand.
What is the expected behavior?
It should be possible to find the connected component instance, not just the inner component instance, as it was in previous versions.
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
The tests run in node, with jest (standard CRA project)
I've just upgraded react-redux from 5.0.7 to 7.0.2 and this started happening
I'm using version react and react-dom version 16.8.4
The text was updated successfully, but these errors were encountered: