Skip to content

Commit

Permalink
Add accessibilityIdentifier to NTP labels group
Browse files Browse the repository at this point in the history
  • Loading branch information
d4r1091 committed May 16, 2024
1 parent ba0c1ec commit 4fd38ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Client/Ecosia/UI/NTP/Impact/ClimateImpactInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ enum ClimateImpactInfo: Equatable {
}
}

var accessibilityIdentifier: String? {
switch self {
case .search:
"personal_trees_counter"
case .referral:
"friends_and_trees_invites_counter"
case .totalTrees:
"total_trees_count"
case .totalInvested:
"total_invested_count"
}
}

var image: UIImage? {
switch self {
case .search:
Expand Down
1 change: 1 addition & 0 deletions Client/Ecosia/UI/NTP/Impact/NTPImpactRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ final class NTPImpactRowView: UIView, Themeable {
vStack.isAccessibilityElement = true
vStack.shouldGroupAccessibilityChildren = true
vStack.accessibilityLabel = info.accessibilityLabel
vStack.accessibilityIdentifier = info.accessibilityIdentifier

hStack.addArrangedSubview(vStack)
hStack.addArrangedSubview(actionButton)
Expand Down

0 comments on commit 4fd38ad

Please sign in to comment.