Updated on 2026-08-14
This commit is contained in:
commit
84f35ac892
2 changed files with 3 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue