Skip to content

Commit ce2349d

Browse files
committed
test: add test tags
1 parent 814aae0 commit ce2349d

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

app/src/main/java/to/bitkit/ui/screens/wallets/sheets/NewTransactionSheet.kt

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import androidx.compose.runtime.getValue
2020
import androidx.compose.ui.Alignment
2121
import androidx.compose.ui.Modifier
2222
import androidx.compose.ui.layout.ContentScale
23+
import androidx.compose.ui.platform.testTag
2324
import androidx.compose.ui.res.painterResource
2425
import androidx.compose.ui.res.stringResource
2526
import androidx.compose.ui.tooling.preview.Preview
@@ -88,7 +89,9 @@ private fun NewTransactionSheetView(
8889
onDetailClick: () -> Unit,
8990
) {
9091
Box(
91-
modifier = Modifier.fillMaxWidth()
92+
modifier = Modifier
93+
.fillMaxWidth()
94+
.testTag("new_transaction_sheet")
9295
) {
9396

9497
if (details.direction == NewTransactionSheetDirection.RECEIVED) {
@@ -98,6 +101,7 @@ private fun NewTransactionSheetView(
98101
contentScale = ContentScale.FillWidth,
99102
modifier = Modifier
100103
.fillMaxWidth()
104+
.testTag("transaction_received_image")
101105
.align(Alignment.BottomEnd)
102106
)
103107
} else {
@@ -108,8 +112,8 @@ private fun NewTransactionSheetView(
108112
modifier = Modifier
109113
.fillMaxWidth()
110114
.padding(horizontal = 16.dp)
115+
.testTag("transaction_sent_image")
111116
.align(Alignment.Center)
112-
113117
)
114118
}
115119

@@ -124,13 +128,16 @@ private fun NewTransactionSheetView(
124128
composition = composition,
125129
contentScale = ContentScale.FillBounds,
126130
iterations = 100,
127-
modifier = Modifier.fillMaxSize()
131+
modifier = Modifier
132+
.fillMaxSize()
133+
.testTag("confetti_animation")
128134
)
129135

130136
Column(
131137
horizontalAlignment = Alignment.CenterHorizontally,
132138
modifier = Modifier
133139
.fillMaxSize()
140+
.testTag("transaction_content_column")
134141
.padding(horizontal = 16.dp),
135142
) {
136143
val titleText = when (details.type) {
@@ -149,32 +156,44 @@ private fun NewTransactionSheetView(
149156

150157
Spacer(modifier = Modifier.height(24.dp))
151158

152-
BalanceHeaderView(sats = details.sats, modifier = Modifier.fillMaxWidth())
159+
BalanceHeaderView(
160+
sats = details.sats,
161+
modifier = Modifier
162+
.fillMaxWidth()
163+
.testTag("balance_header")
164+
)
153165

154166
Spacer(modifier = Modifier.weight(1f))
155167

156168
if (details.direction == NewTransactionSheetDirection.SENT) {
157169
Row(
158170
horizontalArrangement = Arrangement.spacedBy(16.dp),
159-
modifier = Modifier.fillMaxWidth()
171+
modifier = Modifier
172+
.fillMaxWidth()
173+
.testTag("sent_buttons_row")
160174
) {
161175
SecondaryButton(
162176
text = stringResource(R.string.wallet__send_details),
163177
onClick = onDetailClick,
164178
fullWidth = false,
165-
modifier = Modifier.weight(1f)
179+
modifier = Modifier
180+
.weight(1f)
181+
.testTag("details_button")
166182
)
167183
PrimaryButton(
168184
text = stringResource(R.string.common__close),
169185
onClick = onCloseClick,
170186
fullWidth = false,
171-
modifier = Modifier.weight(1f)
187+
modifier = Modifier
188+
.weight(1f)
189+
.testTag("close_button")
172190
)
173191
}
174192
} else {
175193
PrimaryButton(
176194
text = localizedRandom(R.string.common__ok_random),
177195
onClick = onCloseClick,
196+
modifier = Modifier.testTag("ok_button")
178197
)
179198
}
180199

0 commit comments

Comments
 (0)