mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Improve UserSessionNameUITests
This commit is contained in:
parent
7ec2644dfe
commit
48740ba2ec
2 changed files with 16 additions and 0 deletions
|
@ -21,6 +21,7 @@ class UserSessionNameUITests: MockScreenTestCase {
|
||||||
func testUserSessionNameInitialState() {
|
func testUserSessionNameInitialState() {
|
||||||
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.initialName.title)
|
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.initialName.title)
|
||||||
|
|
||||||
|
assertButtonsExists()
|
||||||
let doneButton = app.buttons[VectorL10n.done]
|
let doneButton = app.buttons[VectorL10n.done]
|
||||||
XCTAssertTrue(doneButton.exists)
|
XCTAssertTrue(doneButton.exists)
|
||||||
XCTAssertFalse(doneButton.isEnabled)
|
XCTAssertFalse(doneButton.isEnabled)
|
||||||
|
@ -29,6 +30,7 @@ class UserSessionNameUITests: MockScreenTestCase {
|
||||||
func testUserSessionNameEmptyState() {
|
func testUserSessionNameEmptyState() {
|
||||||
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.empty.title)
|
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.empty.title)
|
||||||
|
|
||||||
|
assertButtonsExists()
|
||||||
let doneButton = app.buttons[VectorL10n.done]
|
let doneButton = app.buttons[VectorL10n.done]
|
||||||
XCTAssertTrue(doneButton.exists)
|
XCTAssertTrue(doneButton.exists)
|
||||||
XCTAssertFalse(doneButton.isEnabled)
|
XCTAssertFalse(doneButton.isEnabled)
|
||||||
|
@ -37,8 +39,21 @@ class UserSessionNameUITests: MockScreenTestCase {
|
||||||
func testUserSessionNameChangedState() {
|
func testUserSessionNameChangedState() {
|
||||||
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.changedName.title)
|
app.goToScreenWithIdentifier(MockUserSessionNameScreenState.changedName.title)
|
||||||
|
|
||||||
|
assertButtonsExists()
|
||||||
let doneButton = app.buttons[VectorL10n.done]
|
let doneButton = app.buttons[VectorL10n.done]
|
||||||
XCTAssertTrue(doneButton.exists)
|
XCTAssertTrue(doneButton.exists)
|
||||||
XCTAssertTrue(doneButton.isEnabled)
|
XCTAssertTrue(doneButton.isEnabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension UserSessionNameUITests {
|
||||||
|
func assertButtonsExists() {
|
||||||
|
let buttons = [VectorL10n.done, VectorL10n.cancel, "LearnMore"]
|
||||||
|
|
||||||
|
for buttonId in buttons {
|
||||||
|
let button = app.buttons[buttonId]
|
||||||
|
button.tap()
|
||||||
|
XCTAssertTrue(button.exists)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ struct UserSessionName: View {
|
||||||
viewModel.send(viewAction: .learnMore)
|
viewModel.send(viewAction: .learnMore)
|
||||||
}
|
}
|
||||||
.foregroundColor(theme.colors.secondaryContent)
|
.foregroundColor(theme.colors.secondaryContent)
|
||||||
|
.accessibility(identifier: "LearnMore")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue