Skip to content

Commit bdf7473

Browse files
acb-mvbuggmagnet
authored andcommitted
Make AccessibilityIdentifier.wireGuardPort tagged with its value
1 parent 627e8f2 commit bdf7473

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

ios/MullvadVPN/Classes/AccessbilityIdentifier.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public enum AccessibilityIdentifier: Equatable {
181181
case wireGuardObfuscationOff
182182
case wireGuardObfuscationUdpOverTcp
183183
case wireGuardObfuscationShadowsocks
184-
case wireGuardPort
184+
case wireGuardPort(UInt16?)
185185
case udpOverTcpObfuscationSettings
186186

187187
// Custom DNS

ios/MullvadVPN/View controllers/SelectLocation/LocationCell.swift

-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ extension LocationCell {
327327
// Only custom list nodes have more than one location. Therefore checking first
328328
// location here is fine.
329329
if let location = item.node.locations.first {
330-
// we can probably replace this with a tagged AccessibilityIdentifier and cut this case statement
331330
let accessibilityId: AccessibilityIdentifier = switch location {
332331
case .country: .countryLocationCell
333332
case .city: .cityLocationCell

ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsCellFactory.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
8080
}
8181

8282
cell.titleLabel.text = portString
83-
// TODO: replace this with a tagged AccessibilityIdentifier
84-
cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString) (\(portString))"
83+
cell.accessibilityIdentifier = "\(item.accessibilityIdentifier.asString)"
8584
cell.applySubCellStyling()
8685

8786
case .wireGuardCustomPort:

ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
112112
return .dnsSettings
113113
case .ipOverrides:
114114
return .ipOverrides
115-
case .wireGuardPort:
116-
return .wireGuardPort
115+
case let .wireGuardPort(port):
116+
return .wireGuardPort(port)
117117
case .wireGuardCustomPort:
118118
return .wireGuardCustomPort
119119
case .wireGuardObfuscationAutomatic:

ios/MullvadVPNUITests/Base/BaseUITestCase.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ class BaseUITestCase: XCTestCase {
214214
/// 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.
215215
func isLoggedIn() -> Bool {
216216
return !app
217-
.otherElements[AccessibilityIdentifier.loginView]
217+
.otherElements[.loginView]
218218
.waitForExistence(timeout: 1.0)
219219
}
220220

221221
func isPresentingSettings() -> Bool {
222222
return app
223-
.otherElements[AccessibilityIdentifier.settingsContainerView]
223+
.otherElements[.settingsContainerView]
224224
.exists
225225
}
226226

@@ -248,7 +248,7 @@ class BaseUITestCase: XCTestCase {
248248

249249
// Ensure changelog is no longer shown
250250
_ = app
251-
.otherElements[AccessibilityIdentifier.changeLogAlert.asString]
251+
.otherElements[.changeLogAlert]
252252
.waitForNonExistence(timeout: Self.shortTimeout)
253253
}
254254

0 commit comments

Comments
 (0)