Browse Source

Attempt to fix test on CI.

The test is failing on CI with this error:
expected instance of: io.element.android.libraries.architecture.Async$Success
but was instance of : io.element.android.libraries.architecture.Async$Loading
with value          : Loading(prevData=null)
pull/2107/head
Benoit Marty 9 months ago committed by Jorge Martín
parent
commit
b9b746bea7
  1. 2
      features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt
  2. 2
      libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt

2
features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt

@ -71,7 +71,7 @@ class LogoutPresenterTest { @@ -71,7 +71,7 @@ class LogoutPresenterTest {
moleculeFlow(RecompositionMode.Immediate) {
presenter.present()
}.test {
skipItems(1)
skipItems(3)
val initialState = awaitItem()
assertThat(initialState.isLastSession).isTrue()
assertThat(initialState.backupUploadState).isEqualTo(BackupUploadState.Unknown)

2
libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt

@ -72,7 +72,7 @@ class FakeEncryptionService : EncryptionService { @@ -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)
}

Loading…
Cancel
Save