Skip to content

Commit

Permalink
Change accessibility identifiers to fixed strings
Browse files Browse the repository at this point in the history
  • Loading branch information
minacle authored and sinoru committed Sep 24, 2021
1 parent 56d3b3d commit 1ac486b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions TweetNest Tests/Shared/TweetNestScreenTests.swift
Expand Up @@ -69,7 +69,7 @@ class TweetNestScreenTests: XCTestCase {
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

app.buttons["Account for \(Self.dispalyUserName)"].tap()
app.buttons["\(Self.dispalyUserName):Account"].tap()

XCTAssertTrue(app.navigationBars[Self.dispalyUserName].staticTexts[Self.dispalyUserName].waitForExistence(timeout: 5))

Expand All @@ -87,7 +87,7 @@ class TweetNestScreenTests: XCTestCase {
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

app.buttons["Followings History for \(Self.dispalyUserName)"].tap()
app.buttons["\(Self.dispalyUserName):FollowingsHistory"].tap()

XCTAssertTrue(app.staticTexts["@Apple"].waitForExistence(timeout: 5))

Expand All @@ -106,7 +106,7 @@ class TweetNestScreenTests: XCTestCase {
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app

app.buttons["Account for \(Self.dispalyUserName)"].tap()
app.buttons["\(Self.dispalyUserName):Account"].tap()

XCTAssertTrue(app.navigationBars[Self.dispalyUserName].staticTexts[Self.dispalyUserName].waitForExistence(timeout: 5))

Expand Down
8 changes: 4 additions & 4 deletions TweetNest/Shared/AppSidebarAccountsSection.swift
Expand Up @@ -82,29 +82,29 @@ struct AppSidebarAccountsSection: View {
accountNavigationLink
.accessibilityElement(children: .ignore)
.accessibilityLabel(accountTitle)
.accessibilityIdentifier(accountTitle)
.accessibilityIdentifier("\(displayAccountName):Account")
.accessibilityAddTraits(.isButton)

let followingsTitle = String(localized: "Followings History for \(displayAccountName)", comment: "Navigation link for followings history, grouped by username.")
followingsNavigationLink
.accessibilityElement(children: .ignore)
.accessibilityLabel(followingsTitle)
.accessibilityIdentifier(followingsTitle)
.accessibilityIdentifier("\(displayAccountName):FollowingsHistory")
.accessibilityAddTraits(.isButton)

let followersTitle = String(localized: "Followers History for \(displayAccountName)", comment: "Navigation link for followers history, grouped by username.")
followersNavigationLink
.accessibilityElement(children: .ignore)
.accessibilityLabel(followersTitle)
.accessibilityIdentifier(followersTitle)
.accessibilityIdentifier("\(displayAccountName):FollowersHistory")
.accessibilityAddTraits(.isButton)

if account.preferences.fetchBlockingUsers {
let blockingTitle = String(localized: "Blocks History for \(displayAccountName)", comment: "Navigation link for blocks history, grouped by username.")
blockingsNavigationLink
.accessibilityElement(children: .ignore)
.accessibilityLabel(blockingTitle)
.accessibilityIdentifier(blockingTitle)
.accessibilityIdentifier("\(displayAccountName):BlocksHistory")
.accessibilityAddTraits(.isButton)
}
}
Expand Down

0 comments on commit 1ac486b

Please sign in to comment.