Don't display security banner for unknown RecoveryState (#3579)
* Don't display security banner for unknown `RecoveryState` * Don't display 'set up recovery' if its status is unknown. Add more screenshot tests. * Update screenshots --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
parent
729334ba4d
commit
f344a1282c
32 changed files with 76 additions and 39 deletions
|
|
@ -186,9 +186,9 @@ class RoomListPresenter @Inject constructor(
|
|||
currentSecurityBannerDismissed -> SecurityBannerState.None
|
||||
syncState == SyncState.Running -> {
|
||||
when (recoveryState) {
|
||||
RecoveryState.UNKNOWN,
|
||||
RecoveryState.DISABLED -> SecurityBannerState.SetUpRecovery
|
||||
RecoveryState.INCOMPLETE -> SecurityBannerState.RecoveryKeyConfirmation
|
||||
RecoveryState.UNKNOWN,
|
||||
RecoveryState.WAITING_FOR_SYNC,
|
||||
RecoveryState.ENABLED -> SecurityBannerState.None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,9 @@ class RoomListPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - handle DismissRecoveryKeyPrompt`() = runTest {
|
||||
val encryptionService = FakeEncryptionService()
|
||||
val encryptionService = FakeEncryptionService().apply {
|
||||
recoveryStateStateFlow.emit(RecoveryState.DISABLED)
|
||||
}
|
||||
val roomListService = FakeRoomListService().apply {
|
||||
postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@ open class SecureBackupRootStateProvider : PreviewParameterProvider<SecureBackup
|
|||
aSecureBackupRootState(backupState = BackupState.UNKNOWN, doesBackupExistOnServer = AsyncData.Success(true)),
|
||||
aSecureBackupRootState(backupState = BackupState.UNKNOWN, doesBackupExistOnServer = AsyncData.Success(false)),
|
||||
aSecureBackupRootState(backupState = BackupState.UNKNOWN, doesBackupExistOnServer = AsyncData.Failure(Exception("An error"))),
|
||||
aSecureBackupRootState(backupState = BackupState.WAITING_FOR_SYNC),
|
||||
aSecureBackupRootState(backupState = BackupState.CREATING),
|
||||
aSecureBackupRootState(backupState = BackupState.RESUMING),
|
||||
aSecureBackupRootState(backupState = BackupState.DOWNLOADING),
|
||||
aSecureBackupRootState(backupState = BackupState.DISABLING),
|
||||
aSecureBackupRootState(backupState = BackupState.ENABLED),
|
||||
aSecureBackupRootState(recoveryState = RecoveryState.UNKNOWN),
|
||||
aSecureBackupRootState(recoveryState = RecoveryState.ENABLED),
|
||||
|
|
|
|||
|
|
@ -143,8 +143,8 @@ fun SecureBackupRootView(
|
|||
|
||||
// Setup recovery
|
||||
when (state.recoveryState) {
|
||||
RecoveryState.WAITING_FOR_SYNC -> Unit
|
||||
RecoveryState.UNKNOWN,
|
||||
RecoveryState.WAITING_FOR_SYNC -> Unit
|
||||
RecoveryState.DISABLED -> {
|
||||
PreferenceText(
|
||||
title = stringResource(id = R.string.screen_chat_backup_recovery_action_setup),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue