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
first of all, thank you for this plugin. It makes testing with enzyme a little less painful 👍.
I just wanted to try the .state check on a fairly simple component that currently looks like this:
describe('MyComponent',function(){describe('when initializing the component',function(){it('should set a default state',function(){constcomponent=shallow(<Component/>);expect(component).to.have.state('items',[]);});});});
_Current behaviour:_
AssertionError: expected to have a 'items' state with the value [], but the value was [].
_Expected Behaviour:_
I would expect the output to be true, e.g. a deep check should happen instead of a regular one.
_Additional Input:_
It would be nice if we could also write something like this if the first parameter of state is a plain object to deep check everything:
expect(MyComponent).to.have.state({items: []});
This would be equivalent to the currently used function below:
ayrton
changed the title
Bug (Feature-Request?): State should allow to check against primitives like []
State should allow to check against primitives like []
Nov 4, 2016
Hi all,
first of all, thank you for this plugin. It makes testing with enzyme a little less painful 👍.
I just wanted to try the .state check on a fairly simple component that currently looks like this:
The test looks like this:
_Current behaviour:_
AssertionError: expected to have a 'items' state with the value [], but the value was [].
_Expected Behaviour:_
I would expect the output to be true, e.g. a deep check should happen instead of a regular one.
_Additional Input:_
It would be nice if we could also write something like this if the first parameter of state is a plain object to deep check everything:
This would be equivalent to the currently used function below:
Thank you again for writing this beauty, hope the feedback is helpful for you.
The text was updated successfully, but these errors were encountered: