mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-27 19:56:57 +02:00
Show recover encryption keys message according to key backup requirement
This commit is contained in:
+6
@@ -40,6 +40,8 @@ class AuthenticationSoftLogoutUITests: MockScreenTest {
|
||||
verifyNoSSO()
|
||||
case .fallback:
|
||||
verifyFallback()
|
||||
case .noKeyBackup:
|
||||
verifyNoKeyBackup()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,4 +197,8 @@ class AuthenticationSoftLogoutUITests: MockScreenTest {
|
||||
XCTAssertEqual(ssoButtons.count, 0, "There should be no SSO button shown.")
|
||||
}
|
||||
|
||||
func verifyNoKeyBackup() {
|
||||
XCTAssertFalse(app.staticTexts["messageLabel2"].exists, "The message 2 should not be shown.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -26,7 +26,8 @@ class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
userDisplayName: "mock_username",
|
||||
deviceId: nil)
|
||||
let viewModel = AuthenticationSoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockMatrixDotOrg)
|
||||
homeserver: .mockMatrixDotOrg,
|
||||
keyBackupNeeded: true)
|
||||
let context = viewModel.context
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
@@ -34,6 +35,7 @@ class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
XCTAssert(context.viewState.hasInvalidPassword, "The view model should start with an invalid password.")
|
||||
XCTAssert(context.viewState.showSSOButtons, "The view model should show SSO buttons for the given homeserver.")
|
||||
XCTAssert(context.viewState.showLoginForm, "The view model should show login form for the given homeserver.")
|
||||
XCTAssert(context.viewState.showRecoverEncryptionKeysMessage, "The view model should show recover encryption keys message.")
|
||||
}
|
||||
|
||||
@MainActor func testInitialStateForNoSSO() async {
|
||||
@@ -42,7 +44,8 @@ class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
userDisplayName: "mock_username",
|
||||
deviceId: nil)
|
||||
let viewModel = AuthenticationSoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockBasicServer)
|
||||
homeserver: .mockBasicServer,
|
||||
keyBackupNeeded: false)
|
||||
let context = viewModel.context
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
@@ -50,6 +53,7 @@ class AuthenticationSoftLogoutViewModelTests: XCTestCase {
|
||||
XCTAssert(context.viewState.hasInvalidPassword, "The view model should start with an invalid password.")
|
||||
XCTAssertFalse(context.viewState.showSSOButtons, "The view model should not show SSO buttons for the given homeserver.")
|
||||
XCTAssert(context.viewState.showLoginForm, "The view model should show login form for the given homeserver.")
|
||||
XCTAssertFalse(context.viewState.showRecoverEncryptionKeysMessage, "The view model should not show recover encryption keys message.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user