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
Another question regarding testing order and number of triggered actions.
Let's say I have a search() action that triggers searchLoading() and then searchResults().
If a search action is coming before the previous is finished, it cancels it (that would happen when typing in a search box, for example)
I would like to do the following:
it('cancels the previous call if any',asyncdone=>{constdispatchThreeSearches=()=>asyncdispatch=>{dispatch(searchBidders({keyword: 'test1'}))dispatch(searchBidders({keyword: 'test2'}))awaitdispatch(searchBidders({keyword: 'test3'}))}expect(dispatchThreeSearches()).toDispatchActions([searchLoading(),searchLoading(),searchLoading(),searchResults({results: mockedResultsForTest3Keyword})])})
After a few tests of the above code, it appears that each action is matched independently of the others, which means it is not possible to test:
Order of dispatched actions
Number of dispatching of the same action (I could put 100's of searchLoading() and it would still pass)
Do you see a way to achieve a more fine grained control over expected actions?
Thanks!
The text was updated successfully, but these errors were encountered:
Another question regarding testing order and number of triggered actions.
Let's say I have a
search()
action that triggerssearchLoading()
and thensearchResults()
.If a search action is coming before the previous is finished, it cancels it (that would happen when typing in a search box, for example)
I would like to do the following:
After a few tests of the above code, it appears that each action is matched independently of the others, which means it is not possible to test:
searchLoading()
and it would still pass)Do you see a way to achieve a more fine grained control over expected actions?
Thanks!
The text was updated successfully, but these errors were encountered: