Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-06 11:39:19 +03:00
commit 84f35ac892
2 changed files with 3 additions and 2 deletions

View file

@ -113,7 +113,7 @@ internal class TangemPayCardLimitSetupModel @Inject constructor(
}
private fun onAmountChange(newValue: String) {
if (newValue.toBigDecimalOrNull() == null) return
if (newValue.isNotEmpty() && newValue.toBigDecimalOrNull() == null) return
uiState.update { state ->
state.copy(
amountFieldModel = state.amountFieldModel.copy(value = newValue),

View file

@ -101,6 +101,7 @@ internal class TangemPayCardLimitSetupModelTest {
) {
val model = createModel()
model.uiState.value.amountFieldModel.onValueChange("100")
model.uiState.value.amountFieldModel.onValueChange(amount)
assertThat(model.uiState.value.isSubmitButtonEnabled).isEqualTo(expectedEnabled)
@ -149,7 +150,7 @@ internal class TangemPayCardLimitSetupModelTest {
Arguments.of("100", true),
Arguments.of("-1", false),
Arguments.of("", false),
Arguments.of("abc", false),
Arguments.of("abc", true),
Arguments.of("1001", false),
)
}