Skip to content

Commit 8a83373

Browse files
committed
adjust sweep button ids
1 parent 88d432c commit 8a83373

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

Bitkit/Components/SheetIntro.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct SheetIntro: View {
1010
let accentColor: Color
1111
let accentFont: ((CGFloat) -> Font)?
1212
let testID: String?
13+
let continueTestID: String?
1314
let onCancel: (() -> Void)?
1415
let onContinue: () -> Void
1516
private var baseTestID: String {
@@ -26,6 +27,7 @@ struct SheetIntro: View {
2627
accentColor: Color = .brandAccent,
2728
accentFont: ((CGFloat) -> Font)? = nil,
2829
testID: String? = nil,
30+
continueTestID: String? = nil,
2931
onCancel: (() -> Void)? = nil,
3032
onContinue: @escaping () -> Void
3133
) {
@@ -38,6 +40,7 @@ struct SheetIntro: View {
3840
self.accentColor = accentColor
3941
self.accentFont = accentFont
4042
self.testID = testID
43+
self.continueTestID = continueTestID
4144
self.onCancel = onCancel
4245
self.onContinue = onContinue
4346
}
@@ -74,6 +77,10 @@ struct SheetIntro: View {
7477
.accessibilityIdentifier(baseTestID)
7578
}
7679

80+
private var continueButtonTestID: String {
81+
continueTestID ?? "\(baseTestID)Continue"
82+
}
83+
7784
@ViewBuilder
7885
private var buttonStack: some View {
7986
if let cancelText, let onCancel {
@@ -91,15 +98,15 @@ struct SheetIntro: View {
9198
) {
9299
onContinue()
93100
}
94-
.accessibilityIdentifier("\(baseTestID)Continue")
101+
.accessibilityIdentifier(continueButtonTestID)
95102
}
96103
} else {
97104
CustomButton(
98105
title: continueText
99106
) {
100107
onContinue()
101108
}
102-
.accessibilityIdentifier("\(baseTestID)Continue")
109+
.accessibilityIdentifier(continueButtonTestID)
103110
}
104111
}
105112
}

Bitkit/Views/Settings/Advanced/SweepPromptSheet.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct SweepPromptSheet: View {
2020
continueText: t("sweep__prompt_sweep"),
2121
cancelText: t("common__cancel"),
2222
testID: "SweepPromptSheet",
23+
continueTestID: "SweepButton",
2324
onCancel: {
2425
sheets.hideSheet()
2526
},

Bitkit/Views/Settings/Advanced/SweepSettingsView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct SweepSettingsView: View {
125125
CustomButton(title: t("sweep__sweep_to_wallet")) {
126126
navigation.navigate(.sweepConfirm)
127127
}
128+
.accessibilityIdentifier("SweepToWalletButton")
128129
}
129130
}
130131

0 commit comments

Comments
 (0)