BIT-145: Add BaseViewModel and update existing ViewModels (#11)

This commit is contained in:
Brian Yencho
2024-06-20 17:08:07 +01:00
committed by Álison Fernandes
parent ee199b9e9f
commit 2ff4912b92
4 changed files with 90 additions and 12 deletions
@@ -12,13 +12,13 @@ class RootNavViewModelTests : BaseViewModelTest() {
@Test
fun `initial state should be splash`() {
val viewModel = RootNavViewModel()
assert(viewModel.state.value is RootNavState.Splash)
assert(viewModel.stateFlow.value is RootNavState.Splash)
}
@Test
fun `state should move from splash to login`() = runTest {
val viewModel = RootNavViewModel()
viewModel.state.test {
viewModel.stateFlow.test {
assert(awaitItem() is RootNavState.Splash)
assert(awaitItem() is RootNavState.Login)
}