Skip to content

Commit

Permalink
Make AccessibilityIdentifier.wireGuardPort tagged with its value
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv authored and buggmagnet committed Dec 10, 2024
1 parent 627e8f2 commit bdf7473
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ios/MullvadVPN/Classes/AccessbilityIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public enum AccessibilityIdentifier: Equatable {
case wireGuardObfuscationOff
case wireGuardObfuscationUdpOverTcp
case wireGuardObfuscationShadowsocks
case wireGuardPort
case wireGuardPort(UInt16?)
case udpOverTcpObfuscationSettings

// Custom DNS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ extension LocationCell {
// Only custom list nodes have more than one location. Therefore checking first
// location here is fine.
if let location = item.node.locations.first {
// we can probably replace this with a tagged AccessibilityIdentifier and cut this case statement
let accessibilityId: AccessibilityIdentifier = switch location {
case .country: .countryLocationCell
case .city: .cityLocationCell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
}

cell.titleLabel.text = portString
// TODO: replace this with a tagged AccessibilityIdentifier
cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString) (\(portString))"
cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString)"
cell.applySubCellStyling()

case .wireGuardCustomPort:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return .dnsSettings
case .ipOverrides:
return .ipOverrides
case .wireGuardPort:
return .wireGuardPort
case let .wireGuardPort(port):
return .wireGuardPort(port)
case .wireGuardCustomPort:
return .wireGuardCustomPort
case .wireGuardObfuscationAutomatic:
Expand Down
6 changes: 3 additions & 3 deletions ios/MullvadVPNUITests/Base/BaseUITestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ class BaseUITestCase: XCTestCase {
/// Check if currently logged on to an account. Note that it is assumed that we are logged in if login view isn't currently shown.
func isLoggedIn() -> Bool {
return !app
.otherElements[AccessibilityIdentifier.loginView]
.otherElements[.loginView]
.waitForExistence(timeout: 1.0)
}

func isPresentingSettings() -> Bool {
return app
.otherElements[AccessibilityIdentifier.settingsContainerView]
.otherElements[.settingsContainerView]
.exists
}

Expand Down Expand Up @@ -248,7 +248,7 @@ class BaseUITestCase: XCTestCase {

// Ensure changelog is no longer shown
_ = app
.otherElements[AccessibilityIdentifier.changeLogAlert.asString]
.otherElements[.changeLogAlert]
.waitForNonExistence(timeout: Self.shortTimeout)
}

Expand Down

0 comments on commit bdf7473

Please sign in to comment.