On a long enough timeline, every test is a flaky test
Now why would anyone use this?
Toasts cover the UI for a while, preventing other actions and matchers from working.
We are in compose world and..
The only good toast is French Toast
Create a generic Toaster interface that will be responsible for all toasts in the app. Install the implementation into the SingletonComponent:
Add the hilt-testing dependency
Time to leverage TestInstallIn.
Any action that should have shown a Toast before, will now add an element in a list instead when running UI tests.
This will just show a good old Toast when ran normally.
Catch you later.