Update remaining strings for FTUE.

Include homeserver in view models/state as needed.
Pre-fill the user's display name as set by the server.
This commit is contained in:
Doug
2022-07-14 11:41:36 +01:00
committed by Doug
parent 5394ed0f4a
commit d5b5101420
48 changed files with 250 additions and 155 deletions
@@ -31,7 +31,9 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
guard let screenState = screenState as? MockAuthenticationServerSelectionScreenState else { fatalError("no screen") }
switch screenState {
case .matrix:
verifyNormalState()
verifyRegisterState()
case .login:
verifyLoginState()
case .emptyAddress:
verifyEmptyAddress()
case .invalidAddress:
@@ -41,7 +43,12 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
}
}
func verifyNormalState() {
func verifyRegisterState() {
let title = app.staticTexts["headerTitle"]
XCTAssertEqual(title.label, VectorL10n.authenticationServerSelectionRegisterTitle)
let message = app.staticTexts["headerMessage"]
XCTAssertEqual(message.label, VectorL10n.authenticationServerSelectionRegisterMessage)
let serverTextField = app.textFields.element
XCTAssertEqual(serverTextField.value as? String, "matrix.org", "The server shown should be matrix.org as passed to the view model init.")
@@ -51,13 +58,20 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
XCTAssertTrue(confirmButton.isEnabled, "The confirm button should be enabled when there is an address.")
let textFieldFooter = app.staticTexts["textFieldFooter"]
XCTAssertTrue(textFieldFooter.exists)
XCTAssertEqual(textFieldFooter.label, VectorL10n.authenticationServerSelectionServerFooter)
XCTAssertFalse(textFieldFooter.exists, "The footer shouldn't be shown when there isn't an error.")
let dismissButton = app.buttons["dismissButton"]
XCTAssertTrue(dismissButton.exists, "The dismiss button should be shown during modal presentation.")
}
func verifyLoginState() {
let title = app.staticTexts["headerTitle"]
XCTAssertEqual(title.label, VectorL10n.authenticationServerSelectionLoginTitle)
let message = app.staticTexts["headerMessage"]
XCTAssertEqual(message.label, VectorL10n.authenticationServerSelectionLoginMessage)
}
func verifyEmptyAddress() {
let serverTextField = app.textFields.element
XCTAssertEqual(serverTextField.value as? String, VectorL10n.authenticationServerSelectionServerUrl, "The text field should show placeholder text in this state.")