googleinterns / play-movies-2020-intern

Apache License 2.0
1 stars 1 forks source link

Fix toast tests, wrap text in DetailsActivity #64

Closed jackstenglein closed 4 years ago

jackstenglein commented 4 years ago

The tests of the offline toast were failing because Espresso does not restart the application between different test methods. This caused an error where the application was prevented from showing toasts in tests because it had already shown 25 toasts. To fix this, I moved the logic that ensures the toast is only shown once into the base ToastApplication class. Doing this caused an issue where the toast tests would run after the toast had already displayed and would not be able to display them again, thus causing a failure. To fix this, I added a method to the ToastApplication class that resets the toastDisplayed flag and made it visible only in the tests.

I also made a slight change to the DetailsActivity that allows the title text to wrap instead of just continuing off screen.

TianyiMu commented 4 years ago

Really great problem solving steps!