mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Renaming screens returns (#829)
* Rename: StartChat -> StartChatScreen * Rename: Login -> LoginScreen * Rename: ServerSelection -> ServerSelectionScreen * Rename: SoftLogout -> SoftLogoutScreen
This commit is contained in:
@@ -19,17 +19,17 @@ import XCTest
|
||||
@testable import ElementX
|
||||
|
||||
class SoftLogoutViewModelTests: XCTestCase {
|
||||
let credentials = SoftLogoutCredentials(userId: "mock_user_id",
|
||||
homeserverName: "https://matrix.org",
|
||||
userDisplayName: "mock_username",
|
||||
deviceId: "ABCDEFGH")
|
||||
|
||||
let credentials = SoftLogoutScreenCredentials(userId: "mock_user_id",
|
||||
homeserverName: "https://matrix.org",
|
||||
userDisplayName: "mock_username",
|
||||
deviceId: "ABCDEFGH")
|
||||
|
||||
@MainActor func testInitialStateForMatrixOrg() {
|
||||
let viewModel = SoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockMatrixDotOrg,
|
||||
keyBackupNeeded: true)
|
||||
let viewModel = SoftLogoutScreenViewModel(credentials: credentials,
|
||||
homeserver: .mockMatrixDotOrg,
|
||||
keyBackupNeeded: true)
|
||||
let context = viewModel.context
|
||||
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
XCTAssert(context.password.isEmpty, "The view model should start with an empty password.")
|
||||
XCTAssertFalse(context.viewState.canSubmit, "The view model should start with an invalid password.")
|
||||
@@ -38,10 +38,10 @@ class SoftLogoutViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
@MainActor func testInitialStateForMatrixOrgPasswordEntered() {
|
||||
let viewModel = SoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockMatrixDotOrg,
|
||||
keyBackupNeeded: true,
|
||||
password: "12345678")
|
||||
let viewModel = SoftLogoutScreenViewModel(credentials: credentials,
|
||||
homeserver: .mockMatrixDotOrg,
|
||||
keyBackupNeeded: true,
|
||||
password: "12345678")
|
||||
let context = viewModel.context
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
@@ -49,13 +49,13 @@ class SoftLogoutViewModelTests: XCTestCase {
|
||||
XCTAssertEqual(context.viewState.loginMode, .password, "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 testInitialStateForBasicServer() {
|
||||
let viewModel = SoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockBasicServer,
|
||||
keyBackupNeeded: false)
|
||||
let viewModel = SoftLogoutScreenViewModel(credentials: credentials,
|
||||
homeserver: .mockBasicServer,
|
||||
keyBackupNeeded: false)
|
||||
let context = viewModel.context
|
||||
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
XCTAssert(context.password.isEmpty, "The view model should start with an empty password.")
|
||||
XCTAssertFalse(context.viewState.canSubmit, "The view model should start with an invalid password.")
|
||||
@@ -64,22 +64,22 @@ class SoftLogoutViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
@MainActor func testInitialStateForOIDC() {
|
||||
let viewModel = SoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockOIDC,
|
||||
keyBackupNeeded: false)
|
||||
let viewModel = SoftLogoutScreenViewModel(credentials: credentials,
|
||||
homeserver: .mockOIDC,
|
||||
keyBackupNeeded: false)
|
||||
let context = viewModel.context
|
||||
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
XCTAssert(context.password.isEmpty, "The view model should start with an empty password.")
|
||||
XCTAssertFalse(context.viewState.canSubmit, "The view model should start with an invalid password.")
|
||||
XCTAssertTrue(context.viewState.loginMode.supportsOIDCFlow, "The view model should show OIDC button for the given homeserver.")
|
||||
XCTAssertFalse(context.viewState.showRecoverEncryptionKeysMessage, "The view model should not show recover encryption keys message.")
|
||||
}
|
||||
|
||||
|
||||
@MainActor func testInitialStateForUnsupported() {
|
||||
let viewModel = SoftLogoutViewModel(credentials: credentials,
|
||||
homeserver: .mockUnsupported,
|
||||
keyBackupNeeded: false)
|
||||
let viewModel = SoftLogoutScreenViewModel(credentials: credentials,
|
||||
homeserver: .mockUnsupported,
|
||||
keyBackupNeeded: false)
|
||||
let context = viewModel.context
|
||||
|
||||
// Given a view model where the user hasn't yet sent the verification email.
|
||||
|
||||
Reference in New Issue
Block a user