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
When a component uses setState() the componentDidUpdate call is supposed to fire and any code within it is supposed to be executed. Enzyme 3.4.1 does not execute the cDU code when setState() is called within the component.
To Reproduce
Steps to reproduce the behavior:
Make sure enzyme 3.4.1 is installed: npm install enzyme@3.4.1
Create a component that takes a callback prop, contains the componentDidUpdate method and another method that calls setState(). The cDU method should execute the callback when it's fired.
Create a test which spies on the callback prop and executes the component method which calls setState()
Notice that the cDU is not executed
Expected behavior
cDU should be executed when a component's setState is called.
Desktop (please complete the following information):
When a component uses
setState()
the componentDidUpdate call is supposed to fire and any code within it is supposed to be executed. Enzyme 3.4.1 does not execute the cDU code whensetState()
is called within the component.To Reproduce
Steps to reproduce the behavior:
npm install enzyme@3.4.1
componentDidUpdate
method and another method that callssetState()
. The cDU method should execute the callback when it's fired.setState()
Expected behavior
cDU should be executed when a component's setState is called.
Desktop (please complete the following information):
Additional context
#1452
#1742 (comment)
Code Sample
https://github.com/ajbogh/enzyme-setstate-bug
The text was updated successfully, but these errors were encountered: