Updated on 2026-08-14
This commit is contained in:
parent
0d32badef4
commit
f2e08b5652
3 changed files with 26 additions and 19 deletions
|
|
@ -43,20 +43,26 @@ class TangemPayDailyLimitTest : BaseTestCase() {
|
|||
},
|
||||
).run {
|
||||
step("Open daily limit setup screen") { openTangemPayDailyLimitSetup() }
|
||||
step("Assert amount field, hint and 'Set limits' button are displayed") {
|
||||
onTangemPayDailyLimitScreen {
|
||||
amountField.assertIsDisplayed()
|
||||
hint.assertIsDisplayed()
|
||||
setLimitsButton.assertIsDisplayed()
|
||||
step("Assert amount field is displayed") {
|
||||
onTangemPayDailyLimitScreen { amountField.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert hint is displayed") {
|
||||
onTangemPayDailyLimitScreen { hint.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert quick value presets are displayed") {
|
||||
onTangemPayDailyLimitScreen {
|
||||
presetChip("1").assertIsDisplayed()
|
||||
presetChip("5000").assertIsDisplayed()
|
||||
presetChip("10000").assertIsDisplayed()
|
||||
presetChip("25000").assertIsDisplayed()
|
||||
step("Assert 'Set limits' button is displayed") {
|
||||
onTangemPayDailyLimitScreen { setLimitsButton.assertIsDisplayed() }
|
||||
}
|
||||
step("Assert quick value preset '1' is displayed") {
|
||||
onTangemPayDailyLimitScreen { presetChip("1").assertIsDisplayed() }
|
||||
}
|
||||
step("Assert quick value preset '5000' is displayed") {
|
||||
onTangemPayDailyLimitScreen { presetChip("5000").assertIsDisplayed() }
|
||||
}
|
||||
step("Assert quick value preset '10000' is displayed") {
|
||||
onTangemPayDailyLimitScreen { presetChip("10000").assertIsDisplayed() }
|
||||
}
|
||||
step("Assert quick value preset '25000' is displayed") {
|
||||
onTangemPayDailyLimitScreen { presetChip("25000").assertIsDisplayed() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ private fun PresetChip(preset: TangemPayCardLimitSetupUM.LimitPresetUM, modifier
|
|||
.clip(RoundedCornerShape(14.dp))
|
||||
.background(TangemTheme.colors3.bg.tertiary)
|
||||
.clickable(onClick = preset.onClick)
|
||||
.then(preset.testTag?.let { Modifier.testTag(it) } ?: Modifier)
|
||||
.testTag(preset.testTag)
|
||||
.padding(horizontal = TangemTheme.dimens2.x5, vertical = TangemTheme.dimens2.x1)
|
||||
.wrapContentHeight(),
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.features.tangempay.limit.setup
|
|||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.test.TangemPayTestTags
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ internal data class TangemPayCardLimitSetupUM(
|
|||
@Immutable
|
||||
internal data class LimitPresetUM(
|
||||
val label: String,
|
||||
val testTag: String?,
|
||||
val testTag: String,
|
||||
val onClick: () -> Unit,
|
||||
)
|
||||
|
||||
|
|
@ -43,10 +44,10 @@ internal data class TangemPayCardLimitSetupUM(
|
|||
subtitle: TextReference = TextReference.Str("Set a limit from $0 to $50,000"),
|
||||
currencyCode: String = "$",
|
||||
presets: ImmutableList<LimitPresetUM> = persistentListOf(
|
||||
LimitPresetUM(label = "$0", testTag = null, onClick = {}),
|
||||
LimitPresetUM(label = "$5,000", testTag = null, onClick = {}),
|
||||
LimitPresetUM(label = "$10,000", testTag = null, onClick = {}),
|
||||
LimitPresetUM(label = "$25,000", testTag = null, onClick = {}),
|
||||
LimitPresetUM(label = "$0", testTag = TangemPayTestTags.dailyLimitPresetChip("0"), onClick = {}),
|
||||
LimitPresetUM(label = "$5,000", testTag = TangemPayTestTags.dailyLimitPresetChip("5000"), onClick = {}),
|
||||
LimitPresetUM(label = "$10,000", testTag = TangemPayTestTags.dailyLimitPresetChip("10000"), onClick = {}),
|
||||
LimitPresetUM(label = "$25,000", testTag = TangemPayTestTags.dailyLimitPresetChip("25000"), onClick = {}),
|
||||
),
|
||||
submitButtonEnabled: Boolean = true,
|
||||
submitButtonLoading: Boolean = false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue