Loading feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/validation/AccountValidationViewModel.kt +1 −15 Original line number Diff line number Diff line Loading @@ -110,22 +110,8 @@ internal class AccountValidationViewModel( } private fun onBack() { if (state.value.isSuccess) { updateState { it.copy( isSuccess = false, ) } } else if (state.value.error != null) { updateState { it.copy( error = null, ) } } else { navigateBack() } } private fun onRetry() { updateState { Loading feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/validation/AccountValidationViewModelTest.kt +0 −32 Original line number Diff line number Diff line Loading @@ -163,38 +163,6 @@ class AccountValidationViewModelTest { } } @Test fun `should clear isSuccess when OnBackClicked event received when in success state`() = runTest { val initialState = State(isSuccess = true) val testSubject = createTestSubject(initialState = initialState) val turbines = turbinesWithInitialStateCheck(testSubject, initialState) testSubject.event(Event.OnBackClicked) assertThatAndMviTurbinesConsumed( actual = turbines.stateTurbine.awaitItem(), turbines = turbines, ) { isEqualTo(initialState.copy(isSuccess = false)) } } @Test fun `should clear error when OnBackClicked event received when in error state`() = runTest { val initialState = State(error = Error.ServerError("server error")) val testSubject = createTestSubject(initialState = initialState) val turbines = turbinesWithInitialStateCheck(testSubject, initialState) testSubject.event(Event.OnBackClicked) assertThatAndMviTurbinesConsumed( actual = turbines.stateTurbine.awaitItem(), turbines = turbines, ) { isEqualTo(initialState.copy(error = null)) } } @Test fun `should clear error and trigger check settings when OnRetryClicked event received`() = runTest { val initialState = State( Loading Loading
feature/account/setup/src/main/kotlin/app/k9mail/feature/account/setup/ui/validation/AccountValidationViewModel.kt +1 −15 Original line number Diff line number Diff line Loading @@ -110,22 +110,8 @@ internal class AccountValidationViewModel( } private fun onBack() { if (state.value.isSuccess) { updateState { it.copy( isSuccess = false, ) } } else if (state.value.error != null) { updateState { it.copy( error = null, ) } } else { navigateBack() } } private fun onRetry() { updateState { Loading
feature/account/setup/src/test/kotlin/app/k9mail/feature/account/setup/ui/validation/AccountValidationViewModelTest.kt +0 −32 Original line number Diff line number Diff line Loading @@ -163,38 +163,6 @@ class AccountValidationViewModelTest { } } @Test fun `should clear isSuccess when OnBackClicked event received when in success state`() = runTest { val initialState = State(isSuccess = true) val testSubject = createTestSubject(initialState = initialState) val turbines = turbinesWithInitialStateCheck(testSubject, initialState) testSubject.event(Event.OnBackClicked) assertThatAndMviTurbinesConsumed( actual = turbines.stateTurbine.awaitItem(), turbines = turbines, ) { isEqualTo(initialState.copy(isSuccess = false)) } } @Test fun `should clear error when OnBackClicked event received when in error state`() = runTest { val initialState = State(error = Error.ServerError("server error")) val testSubject = createTestSubject(initialState = initialState) val turbines = turbinesWithInitialStateCheck(testSubject, initialState) testSubject.event(Event.OnBackClicked) assertThatAndMviTurbinesConsumed( actual = turbines.stateTurbine.awaitItem(), turbines = turbines, ) { isEqualTo(initialState.copy(error = null)) } } @Test fun `should clear error and trigger check settings when OnRetryClicked event received`() = runTest { val initialState = State( Loading