From b9b746bea7ea8511865fbb28e1e4870951845a7d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 20 Dec 2023 09:15:50 +0100 Subject: [PATCH] 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) --- .../element/android/features/logout/impl/LogoutPresenterTest.kt | 2 +- .../libraries/matrix/test/encryption/FakeEncryptionService.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt b/features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt index 75401c290a..c486e76312 100644 --- a/features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt +++ b/features/logout/impl/src/test/kotlin/io/element/android/features/logout/impl/LogoutPresenterTest.kt @@ -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) diff --git a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt index 44b9d734a5..aafb2e8074 100644 --- a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt +++ b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt @@ -72,7 +72,7 @@ class FakeEncryptionService : EncryptionService { this.isLastDevice = isLastDevice } - override suspend fun isLastDevice(): Result { + override suspend fun isLastDevice(): Result = simulateLongTask { return Result.success(isLastDevice) }