#1147 # Current behavior
I cannot find(Component|".selector") but I can see it via html() and via .contains()
code
<input type='text' name='Name'>
{isPasswordRequired &&
<input type='password' name='Password'>}
the isPasswordRequired value is set to true with a button click.
I simulated the button click and the boolean is set to true but still the .find() method is not able to find the given component.
test
//simulate button click
wrapper.update();
//works fine
wrapper.contains('input[name="Password"]');
// gives error .props() meant to be run on 1 node, 0 found instead.
wrapper.find('input[name="Password"]').props();
Expected behaviour
.contains(), .find() should return consistent results.
Your environment
MacOS mojave 10.14.6
node : v12.12.2
npm: 6.14.1
API
Version
| library |
version |
| enzyme |
3.9.0 |
| react |
16.8.6 |
| react-dom |
16.8.6 |
| react-test-renderer |
|
| adapter (below) |
|
Adapter
#1147 # Current behavior
I cannot find(Component|".selector") but I can see it via html() and via .contains()
code
the isPasswordRequired value is set to true with a button click.
I simulated the button click and the boolean is set to true but still the .find() method is not able to find the given component.
test
Expected behaviour
.contains(), .find() should return consistent results.
Your environment
MacOS mojave 10.14.6
node : v12.12.2
npm: 6.14.1
API
Version
Adapter