-
-
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
MountedTraversal.pathToNode() potentially returns descendants #790
Comments
This is what I come up with as a "trace" for the execution of the above problematic case:
That manual trace is consistent with the results I actually get when calling the function. So the problem is that |
Which version of enzyme are you using? |
2.6.0 Updated the original post to reflect that, sorry. |
@ljharb Yep, that's done the trick. Thank you for your help. |
Please correct me if I'm wrong, but I think the implementation of the
MountedTraversal.js:pathToNode()
function is flawed.Consider this slice of a DOM:
If I call
pathToNode()
like so:...then I get the
div[data-name="secondChildChildren"]
element as the last element in theresult
array, yet that is not a parent/ancestor of thenode
, it is a descendant.Enzyme version: 2.6.0
Am I missing something, or is this a legitimate problem?
The text was updated successfully, but these errors were encountered: