Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ struct SettingsMultihopView<ViewModel>: View where ViewModel: TunnelSettingsObse
: Color(UIColor.Cell.titleTextColor)
)
Spacer().frame(width: UIMetrics.SettingsCell.selectableSettingsCellLeftViewSpacing)
Text(option.label)
Button(option.label, action: { tunnelViewModel.value = option.id })
.foregroundStyle(
(tunnelViewModel.value == option.id)
? Color(UIColor.Cell.Background.selected)
: Color(UIColor.Cell.titleTextColor)
)
.accessibilityIdentifier(option.accessibilityIdentifier.asString)
Spacer()
}
.padding(EdgeInsets(UIMetrics.SettingsCell.defaultLayoutMargins))
Expand Down Expand Up @@ -112,7 +113,6 @@ struct SettingsMultihopView<ViewModel>: View where ViewModel: TunnelSettingsObse
.onTapGesture {
tunnelViewModel.value = option.id
}
.accessibilityIdentifier(option.accessibilityIdentifier.asString)
}
}
.cornerRadius(16)
Expand Down
7 changes: 7 additions & 0 deletions ios/MullvadVPNUITests/Pages/MultihopPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MultihopPage: Page {
return self
}

// the old on/off UI; delete once we get rid of the code
@discardableResult func tapEnableSwitch() -> Self {
app.switches[AccessibilityIdentifier.multihopSwitch].tap()
return self
Expand All @@ -40,4 +41,10 @@ class MultihopPage: Page {
}
return self
}

// the new, tristate UI
@discardableResult func tapMultihopAlways() -> Self {
app.buttons[AccessibilityIdentifier.multihopAlways].tap()
return self
}
}
4 changes: 2 additions & 2 deletions ios/MullvadVPNUITests/RelayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@

MultihopPage(app)
.verifyOnePage()
.tapEnableSwitch()
.tapMultihopAlways()
.tapBackButton()

SettingsPage(app)
Expand Down Expand Up @@ -561,7 +561,7 @@

MultihopPage(app)
.verifyOnePage()
.tapEnableSwitch()
.tapMultihopAlways()
.tapBackButton()

SettingsPage(app)
Expand Down Expand Up @@ -800,7 +800,7 @@

// The capture will contain several streams where `other_addr` contains the IP the device connected to
// One stream will be for the source port, the other for the destination port
let streamFromPeerToRelay = try XCTUnwrap(

Check failure on line 803 in ios/MullvadVPNUITests/RelayTests.swift

View workflow job for this annotation

GitHub Actions / reuse-e2e-workflow / Run tests (RelayTests)

testWireGuardOverTCPCustomPort80, XCTUnwrap failed: expected non-nil value of type "Stream"
capturedStreams.filter { $0.destinationAddress == connectedToIPAddress && $0.destinationPort == port }.first
)

Expand Down
Loading