Closed grischenko-v closed 4 years ago
The problem is React passing an event argument to onClick
, but since you don't use it in any way, you don't specify it in onClick
signature. So method matchers length doesn't equal to arguments length.
What would be nice for such cases is a matcher that would match any number of arguments.
I found a workaround to use capture(testStoreMocked.onClick).first()
instead of verify
. It'll throw an exception if there was no onClick
calls.
Thank you!
I am trying to test store method call. When I run this test:
I get the error:
But this work fun: