mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
SecureBackup: improve error flow when backup state cannot be retrieved, and add tests.
This commit is contained in:
+6
-1
@@ -34,6 +34,7 @@ class FakeEncryptionService : EncryptionService {
|
||||
private var waitForBackupUploadSteadyStateFlow: Flow<BackupUploadState> = flowOf()
|
||||
|
||||
private var fixRecoveryIssuesFailure: Exception? = null
|
||||
private var doesBackupExistOnServerResult: Result<Boolean> = Result.success(true)
|
||||
|
||||
override suspend fun enableBackups(): Result<Unit> = simulateLongTask {
|
||||
return Result.success(Unit)
|
||||
@@ -52,8 +53,12 @@ class FakeEncryptionService : EncryptionService {
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
fun givenDoesBackupExistOnServerResult(result: Result<Boolean>) {
|
||||
doesBackupExistOnServerResult = result
|
||||
}
|
||||
|
||||
override suspend fun doesBackupExistOnServer(): Result<Boolean> = simulateLongTask {
|
||||
return Result.success(true)
|
||||
return doesBackupExistOnServerResult
|
||||
}
|
||||
|
||||
override suspend fun fixRecoveryIssues(recoveryKey: String): Result<Unit> = simulateLongTask {
|
||||
|
||||
Reference in New Issue
Block a user