-
-
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
dive() breaks when using the new context API. #1647
Comments
If you're using the latest version of |
@ljharb I can confirm that I am seeing this error when using the latest version of Also, just for reference, this is the error I'm seeing:
|
Also, just for reference, this is what
|
@anthonator thanks - could you provide a complete minimal test case? |
@ljharb I believe @stellarhoof already provided a test case. Is there something more you need? |
@ljharb https://codesandbox.io/s/9l1rk4l20y?module=%2Fsrc%2FApp.test.js Let me know if this is what you're looking for. |
+1 I'm seeing the same problem. |
I just upgraded to Enzyme 3.4.1 but still getting the same error ( |
@paddotk it's not been fixed yet. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is there any way we can help with this? I tried digging into the code a little while ago and found it hard to follow. If I remember correctly, bypassing this check (and the error message it throws) https://github.com/airbnb/enzyme/blob/0bbdc988b149b8e75ff8cb530ab740b0459ce43d/packages/enzyme/src/ShallowWrapper.js#L1411 casued issues later on. I'm not really sure what needs to be done. I could try playing with it again. I would love to move forward with an upgrade and this is the only thing holding us back as we've used dive a lot of places in our tests. |
@OzzieOrca the issue, I think, is a bit deeper than that. Although |
That's helpful, thanks. I might take a look at it again sometime soon unless someone more knowledgeable is able to jump on it. |
Is there a workaround for this issue? Getting this when testing redux connected components. |
@alexandrudanpop downgrade to react-redux < 6, iirc. |
Nvm. Assuming you meant |
I would love to help here if possible, can I get some pointers on where to start? Currently, this completely blocks us from moving to either |
@ljharb I apologise for being a nag, but what is the status on those PR:s being merged? Can we assist in any way? |
Describe the bug
The new React context elements (https://reactjs.org/docs/context.html) report their type as objects instead of functions (custom react components) or strings (native react components), which breaks
dive()
. I haven't tested whether other methods ofShallowWrapper
break.To Reproduce
https://codesandbox.io/s/zxj4898zxp?module=%2Fsrc%2FApp.test.js
Expected behavior
shallow
anddive
should implement actual render semantics when handling the new context API:I'm sure the above are not the exact semantics, but at least the most intuitive.
The text was updated successfully, but these errors were encountered: