Skip to content

Commit 4520b3b

Browse files
committed
test: add test tags
1 parent 55149b1 commit 4520b3b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/src/main/java/to/bitkit/ui/screens/wallets/send/SendAmountScreen.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import androidx.compose.runtime.remember
1717
import androidx.compose.runtime.setValue
1818
import androidx.compose.ui.Alignment
1919
import androidx.compose.ui.Modifier
20+
import androidx.compose.ui.platform.testTag
2021
import androidx.compose.ui.res.stringResource
2122
import androidx.compose.ui.tooling.preview.Preview
2223
import androidx.compose.ui.unit.dp
@@ -83,7 +84,7 @@ fun SendAmountScreen(
8384
}
8485

8586
@Composable
86-
private fun SendAmountContent(
87+
fun SendAmountContent(
8788
input: String,
8889
walletUiState: MainUiState,
8990
uiState: SendUiState,
@@ -97,6 +98,7 @@ private fun SendAmountContent(
9798
modifier = Modifier
9899
.fillMaxSize()
99100
.gradientBackground()
101+
.testTag("send_amount_screen")
100102
) {
101103
SheetTopBar(stringResource(R.string.title_send_amount)) {
102104
onEvent(SendEvent.AmountReset)
@@ -120,6 +122,7 @@ private fun SendAmountContent(
120122
modifier = Modifier
121123
.fillMaxWidth()
122124
.weight(1f)
125+
.testTag("sync_node_view")
123126
)
124127
}
125128
}
@@ -145,14 +148,15 @@ private fun SendAmountNodeRunning(
145148
) {
146149
Spacer(Modifier.height(16.dp))
147150

148-
NumberPadTextField(input = input, modifier = Modifier.fillMaxWidth())
151+
NumberPadTextField(input = input, modifier = Modifier.fillMaxWidth().testTag("amount_input_field"))
149152

150153
Spacer(modifier = Modifier.height(24.dp))
151154
Spacer(modifier = Modifier.weight(1f))
152155

153156
Text13Up(
154157
text = stringResource(R.string.wallet__send_available),
155158
color = Colors.White64,
159+
modifier = Modifier.testTag("available_balance")
156160
)
157161
Spacer(modifier = Modifier.height(4.dp))
158162

@@ -178,7 +182,7 @@ private fun SendAmountNodeRunning(
178182
onInputChanged(if (input.length > 1) input.dropLast(1) else "0")
179183
},
180184
isDecimal = currencyUiState.primaryDisplay == PrimaryDisplay.FIAT,
181-
modifier = Modifier.fillMaxWidth(),
185+
modifier = Modifier.fillMaxWidth().testTag("amount_keyboard"),
182186
)
183187

184188
Spacer(modifier = Modifier.height(41.dp))
@@ -187,6 +191,7 @@ private fun SendAmountNodeRunning(
187191
text = stringResource(R.string.continue_button),
188192
enabled = uiState.isAmountInputValid,
189193
onClick = { onEvent(SendEvent.AmountContinue(uiState.amountInput)) },
194+
modifier = Modifier.testTag("continue_button")
190195
)
191196

192197
Spacer(modifier = Modifier.height(16.dp))
@@ -205,7 +210,7 @@ private fun PaymentMethodButton(
205210
SendMethod.ONCHAIN -> Colors.Brand
206211
SendMethod.LIGHTNING -> Colors.Purple
207212
},
208-
modifier = Modifier.height(28.dp)
213+
modifier = Modifier.height(28.dp).testTag("payment_method_button")
209214
) {
210215
Text13Up(
211216
text = when (uiState.payMethod) {

0 commit comments

Comments
 (0)