[MatrixSDK] make tests passes

This commit is contained in:
ganfra 2023-03-13 21:12:42 +01:00
parent 801eecfe8d
commit 497fd635f8
5 changed files with 10 additions and 6 deletions

View file

@ -60,8 +60,13 @@ class FakeAuthenticationService : MatrixAuthenticationService {
override suspend fun login(username: String, password: String): Result<SessionId> {
delay(100)
loginError?.let { throw it }
return Result.success(A_USER_ID)
return loginError.let { loginError ->
if (loginError == null) {
Result.success(A_USER_ID)
} else {
Result.failure(loginError)
}
}
}
fun givenLoginError(throwable: Throwable?) {