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
Sorry if the issues are not the correct place to ask a question!
I'd like to assert that an action is causing some other actions to trigger, but not others.
For example, doStuff() should trigger fooHappened() but not barDidNot()
Example code that I would like to build:
it('does stuff as expected',asyncdone=>{expect(doStuff()).toDispatchActions([fooHappened()],done).toNotDispatchActions([barDidNot()],done)})
Two things seem problematic above:
Chaining the expectations? (I think not)
Async management: calling done two times is probably going to break?
Currently, I'm making two different tests to assert for the same action, one to check what triggers as expected, one to check what is not triggered as expected
Is this the right way to do it?
Thanks for the hints.
The text was updated successfully, but these errors were encountered:
Hi, unfortunately with the current implementation it is not possible to chain the assertions, but I think you can just do two asserts one by one, something like this (not sure about using the awaits though):
it('does stuff as expected',async()=>{constaction=awaitdoStuff()awaitexpect(action).toDispatchActions([fooHappened()])awaitexpect(action).toNotDispatchActions([barDidNot()])})
Sorry if the issues are not the correct place to ask a question!
I'd like to assert that an action is causing some other actions to trigger, but not others.
For example,
doStuff()
should triggerfooHappened()
but notbarDidNot()
Example code that I would like to build:
Two things seem problematic above:
done
two times is probably going to break?Currently, I'm making two different tests to assert for the same action, one to check what triggers as expected, one to check what is not triggered as expected
Is this the right way to do it?
Thanks for the hints.
The text was updated successfully, but these errors were encountered: