-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
v3.0 fails to find components wrapped in conditional rendering logic #1188
Comments
I think this issue is a duplicate of #1163 |
It seems that you need to call |
Do you know which are those situations? I'm currently in a situation where the render tree doesn't update even after calling wrapper.update();
wrapper.find(ChildComponent).instance().props.value; // correct, updated value
wrapper.find(ChildComponent).prop('value'); // wrong, stale value Since I cannot call |
I confirmed this issue is fixed for me by locally patching Merge pull request #1169 from neoziro/react-16-updated-props |
This is hopefully fixed in |
@lelandrichardson It fixed the same issue for me. Thanks a lot:) |
@lelandrichardson i m still able to reproduce this issue on
part of code that cause problem:
Then, if i will do mount().html() i will see that everything is fine, but i will be not able to find CreditCard component by id or any selector. After removing if condition(with returning of Loader) tests wil pass. trick with mount().update() helping, but this is a trick |
Can we reopen an issue? |
@Faradey27 Can you try using the latest test-renderer? I think 15.6 only works with react v15.6. |
@asdf123101 @Faradey27 actually, you should remove the test renderer entirely with react 16; it's only a peer dep for < 16. |
Given a component looks like this.
Enzyme 3.0 fails to find the
<span/>
in theConditional
component,This pattern worked in v2.x.
Curiously, if
isActive
is explicitly set totrue
, enzyme can find the<span />
.The text was updated successfully, but these errors were encountered: