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

This commit is contained in:
Brian Yencho
2023-08-28 09:37:05 -05:00
committed by GitHub
parent b09df2fa5a
commit ece5fe6a37
4 changed files with 90 additions and 12 deletions

View File

@@ -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)
}