Second attempt...

This commit is contained in:
Benoit Marty 2023-12-20 14:33:16 +01:00
parent 139f5cdf72
commit f94f5e4713
2 changed files with 3 additions and 4 deletions

View file

@ -71,8 +71,7 @@ class LogoutPresenterTest {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
val initialState = awaitItem()
val initialState = awaitLastSequentialItem()
assertThat(initialState.isLastSession).isTrue()
assertThat(initialState.backupUploadState).isEqualTo(BackupUploadState.Unknown)
assertThat(initialState.showConfirmationDialog).isFalse()
@ -145,7 +144,7 @@ class LogoutPresenterTest {
val loadingState = awaitItem()
assertThat(loadingState.showConfirmationDialog).isFalse()
assertThat(loadingState.logoutAction).isInstanceOf(Async.Loading::class.java)
val successState = awaitLastSequentialItem()
val successState = awaitItem()
assertThat(successState.logoutAction).isInstanceOf(Async.Success::class.java)
}
}

View file

@ -72,7 +72,7 @@ class FakeEncryptionService : EncryptionService {
this.isLastDevice = isLastDevice
}
override suspend fun isLastDevice(): Result<Boolean> {
override suspend fun isLastDevice(): Result<Boolean> = simulateLongTask {
return Result.success(isLastDevice)
}