Issue
The Expresso doesn't wait for the message to be delivered, resulting that the interface is not updated before asserts to the action are performed. How to force it to wait?
Solution
It seems there is no way to force express to wait in this case, or at least, i could find it. The solution i found is to send synchronous messages using method sendBroadcastSync
instead of sendBroadcast
.
To avoid smelly code, i wrapped the LocalBroadcastManager in an abstraction and replaced the wrapper by a mocked version of it in the test, so it can have a different behavior for testing.
Answered By - MiguelSlv
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.