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
Previously, when using 3.3.x the code and test outlined in the reproduction steps would pass. Now in 3.4.x it does not. It is unclear if this is a case of our code / test being wrong, or if enzyme has accidentally regressed something whilst trying to land React 16 features.
Several of our tests, are failing now, but I've isolated down one of them to the most minimal recreate possible - stripping out all props and ensuring it still acts as we've observed.
To Reproduce
Steps to reproduce the behavior:
Here's a minimal test case for the simplest of the tests that are now failing...
Create a react component like so:
Expected behavior
A clear and concise description of what you expected to happen.
In 3.3.x, this test case passed. Wrapper had length 1, and wrapper.find(div) had length 0.
In 3.4.x the expect statement expect(wrapper).toHaveLength(1) fails with length 0.
If you need any more information, let me know. I can't see anything obviously wrong with our code (the re-create is minimal, but we need to check the logic based on a large combination of props -> which, for this has boiled down to the recreate above once you strip out the logic).
The text was updated successfully, but these errors were encountered:
This was a bug in < 3.4; and components rendering arrays is still not fully supported in enzyme (see #1213).
In this case, a component that returns an empty array is basically identical to one returning null - both don’t actually render anything. It was incorrect for enzyme to ever return a length of 1 there.
Describe the bug
Previously, when using 3.3.x the code and test outlined in the reproduction steps would pass. Now in 3.4.x it does not. It is unclear if this is a case of our code / test being wrong, or if enzyme has accidentally regressed something whilst trying to land React 16 features.
Several of our tests, are failing now, but I've isolated down one of them to the most minimal recreate possible - stripping out all props and ensuring it still acts as we've observed.
To Reproduce
Steps to reproduce the behavior:
Here's a minimal test case for the simplest of the tests that are now failing...
Create a react component like so:
Create a jest test like so:
Test this out against
[email protected]
[email protected]
[email protected]
flipping between [email protected] and [email protected]
Expected behavior
A clear and concise description of what you expected to happen.
In 3.3.x, this test case passed. Wrapper had length 1, and wrapper.find(div) had length 0.
In 3.4.x the expect statement
expect(wrapper).toHaveLength(1)
fails with length 0.Additional context
[email protected] (previously 3.4.0)
[email protected]
[email protected]
[email protected]
If you need any more information, let me know. I can't see anything obviously wrong with our code (the re-create is minimal, but we need to check the logic based on a large combination of props -> which, for this has boiled down to the recreate above once you strip out the logic).
The text was updated successfully, but these errors were encountered: