Skip to content

Commit b157a2d

Browse files
committed
accessibility ids
1 parent 0f0e28b commit b157a2d

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

Bitkit/Components/NumberPadTextField.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ struct NumberPadTextField: View {
7171
}
7272
.contentShape(Rectangle())
7373
.animation(springAnimation, value: currency.primaryDisplay)
74+
.accessibilityElement(children: .contain)
75+
.accessibilityIdentifierIfPresent(testIdentifier)
7476
}
7577

7678
@ViewBuilder
@@ -87,7 +89,6 @@ struct NumberPadTextField: View {
8789
+ Text(viewModel.getPlaceholder(currency: currency))
8890
.foregroundColor(isFocused ? .textSecondary : .textPrimary))
8991
.font(.custom(Fonts.black, size: 44))
90-
.accessibilityIdentifierIfPresent(testIdentifier)
9192
}
9293
}
9394
}

Bitkit/Views/Transfer/FundManualAmountView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct FundManualAmountView: View {
5757
isDisabled: amountSats == 0,
5858
destination: FundManualConfirmView(lnPeer: lnPeer, amountSats: amountSats)
5959
)
60+
.accessibilityIdentifier("ExternalAmountContinue")
6061
}
6162
}
6263
.navigationBarHidden(true)

Bitkit/Views/Transfer/SpendingAdvancedView.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ struct SpendingAdvancedView: View {
3434
DisplayText(t("lightning__spending_advanced__title"), accentColor: .purpleAccent)
3535
.fixedSize(horizontal: false, vertical: true)
3636

37-
NumberPadTextField(viewModel: amountViewModel, showConversion: false)
38-
.onTapGesture {
39-
amountViewModel.togglePrimaryDisplay(currency: currency)
40-
}
41-
.padding(.top, 32)
37+
NumberPadTextField(
38+
viewModel: amountViewModel,
39+
showConversion: false,
40+
testIdentifier: "SpendingAdvancedNumberField"
41+
)
42+
.onTapGesture {
43+
amountViewModel.togglePrimaryDisplay(currency: currency)
44+
}
45+
.padding(.top, 32)
4246

4347
// Fee estimate
4448
HStack(spacing: 4) {

Bitkit/Views/Transfer/SpendingAmount.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ struct SpendingAmount: View {
103103
guard let max = maxTransferAmount else { return }
104104
amountViewModel.updateFromSats(max, currency: currency)
105105
}
106+
.accessibilityIdentifier("SpendingAmountMax")
106107
}
107108
}
108109

Bitkit/Views/Wallets/Receive/ReceiveEdit.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ struct ReceiveEdit: View {
2626
SheetHeader(title: t("wallet__receive_specify"), showBackButton: true)
2727

2828
VStack(alignment: .leading, spacing: 0) {
29-
NumberPadTextField(viewModel: amountViewModel, isFocused: isAmountInputFocused)
30-
.padding(.bottom, isAmountInputFocused ? 0 : 32)
31-
.onTapGesture {
32-
if isAmountInputFocused {
33-
amountViewModel.togglePrimaryDisplay(currency: currency)
34-
} else {
35-
isAmountInputFocused = true
36-
}
29+
NumberPadTextField(
30+
viewModel: amountViewModel,
31+
isFocused: isAmountInputFocused,
32+
testIdentifier: "ReceiveNumberPadTextField"
33+
)
34+
.padding(.bottom, isAmountInputFocused ? 0 : 32)
35+
.onTapGesture {
36+
if isAmountInputFocused {
37+
amountViewModel.togglePrimaryDisplay(currency: currency)
38+
} else {
39+
isAmountInputFocused = true
3740
}
38-
.accessibilityIdentifier("ReceiveNumberPadTextField")
41+
}
3942

4043
if !isAmountInputFocused {
4144
CaptionMText(t("wallet__note"))

0 commit comments

Comments
 (0)