#1098 - Stopped relying on the SDK in the suggestionService and added unit and ui tests.

This commit is contained in:
Stefan Ceriu
2021-10-06 14:42:48 +03:00
parent 9724409fc0
commit af4b5dc1aa
11 changed files with 294 additions and 268 deletions
@@ -31,17 +31,10 @@ class UserSuggestionUITests: MockScreenTest {
}
func verifyUserSuggestionScreen() throws {
guard let screenState = screenState as? MockUserSuggestionScreenState else { fatalError("no screen") }
switch screenState {
case .longDisplayName(let name):
verifyUserSuggestionLongName(name: name)
}
XCTAssert(app.tables.firstMatch.exists)
let firstButton = app.tables.firstMatch.buttons.firstMatch
_ = firstButton.waitForExistence(timeout: 10)
XCTAssert(firstButton.identifier == "displayNameText-userIdText")
}
func verifyUserSuggestionLongName(name: String) {
let displayNameText = app.staticTexts["displayNameText"]
XCTAssert(displayNameText.exists)
XCTAssertEqual(displayNameText.label, name)
}
}