-
-
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
TypeError: Cannot read property 'reverse' of null #410
Comments
Hey @vlkosinov thanks so much for the issue report. This does indeed seem to be a bug in enzyme. I was able to create a simple repro case you can see here: https://github.com/Aweary/enzyme-test-repo/blob/issue-410/test.js class App extends React.Component {
render() {
return (
<div>Hello, world</div>
);
}
}
describe('Repro case for issue #401', () => {
it('shouldnt throw when calling parent() in findWhere()', () => {
const wrapper = mount(<App/>);
wrapper.findWhere(n => n.parent())
}); The issue appears to be calling |
I think either |
Just a heads up this issue still persists, I just ran into this issue myself on "enzyme": "2.4.1" |
Currently, I could reproduce the problem with simplest code example: see #769. Also, I tried to fix it but didn't succeed, because there is something wrong with |
I just ran into this problem. Does anybody know a good solution? |
Did anyone get a solution for this? Is there any temporary workaround? |
The tests are in #769; I'm not aware of a fix yet. |
Thanks, I will check it out |
Is this related to #534? (Not sure, but even if it's clearly not, it may be worth pointing that out.) |
👍 |
@vlkosinov is this still an issue in enzyme 3? |
@ljharb It appears to be. I'm seeing it in 3.2.0, e.g. with something like: const wrapper = mount(<Account />),
mobileParent = wrapper.find({role: 'input', name: 'mobile'}).parent() |
Is this somehow related to gettting the parent() of a parent()? Previously my enzyme v2 tests succeeded, but now in v3 doing:
gives out the error:
|
For me the easiest work around is to select the parent, and find() within that, rather than going to the node and looking for the parent. |
Thank you very much for this library! ❤️
I'm trying to test a library which provides some Higher-order Component, but I get a weird bug.
Example:
Enhancer:
Component to enchace:
Main component:
I want to ensure that the Enhancer adds additional prop 'someAdditionalProp' to composed components, so I'm doing the following:
And get error message:
Essentially, the error occurs when we attempt to call the
parent
method on ReactWrapper aroundFoo
:Any ideas on how to solve this problem? 😊
The text was updated successfully, but these errors were encountered: