Menstruation Nation (M. Nation) is a free period tracker designed for youth. The app helps people learn more about their bodies by tracking their period cycle and symptoms.
All tests under` CalendarCycleTabTest` are failing
The problem is where databaseIsLoadedFromStorage.postValue(true) is placed in AppViewModel. Before it is placed outside of the view model so it's executed immediately and the UI is not actually showing the loading screen when waiting to fetch database.
This caused the tests to fail because after properly using async operations (and I moved databaseIsLoadedFromStorage.postValue(true) to after the fetching operation is complete), the tests are not waiting for the loading to complete and tried to navigate around when it's still showing the loading screen.
For this patch, I will update databaseIsLoadedFromStorage immediately when AppViewModel.loadData is called to make the tests pass, but the tests needs to be fixed either to
Wait for asynchronous loading to complete
Jump over the loading screen to the calendar screen immediately
The problem is where
databaseIsLoadedFromStorage.postValue(true)
is placed inAppViewModel
. Before it is placed outside of the view model so it's executed immediately and the UI is not actually showing the loading screen when waiting to fetch database.This caused the tests to fail because after properly using async operations (and I moved
databaseIsLoadedFromStorage.postValue(true)
to after the fetching operation is complete), the tests are not waiting for the loading to complete and tried to navigate around when it's still showing the loading screen.For this patch, I will update
databaseIsLoadedFromStorage
immediately whenAppViewModel.loadData
is called to make the tests pass, but the tests needs to be fixed either toOriginally posted by @leowrites in https://github.com/uoftblueprint/the-period-purse-2023/issues/167#issuecomment-1625431744