From b7b691f4c4e64589e8c10bdbf8247278a12195e9 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 18 Dec 2024 09:31:14 +0100 Subject: [PATCH] Fixed unit tests --- .../woopos/cashpayment/WooPosCashPaymentViewModelTest.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/woopos/cashpayment/WooPosCashPaymentViewModelTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/woopos/cashpayment/WooPosCashPaymentViewModelTest.kt index 8f2296be282..92387042644 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/woopos/cashpayment/WooPosCashPaymentViewModelTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/woopos/cashpayment/WooPosCashPaymentViewModelTest.kt @@ -57,8 +57,6 @@ class WooPosCashPaymentViewModelTest { .thenReturn("Complete Order") whenever(resourceProvider.getString(R.string.woopos_cash_payment_change_due, "20.00")) .thenReturn("Change Due: $20.00") - whenever(resourceProvider.getString(R.string.woopos_cash_payment_no_chang_due)) - .thenReturn("No Change Due") val savedStateHandle = SavedStateHandle(mapOf("orderId" to orderId)) @@ -108,11 +106,9 @@ class WooPosCashPaymentViewModelTest { } @Test - fun `given invalid amount less than total, when onUIEvent AmountChanged, then button is disabled and no change due`() = runTest { + fun `given invalid amount less than total, when onUIEvent AmountChanged, then button is disabled`() = runTest { // GIVEN val enteredAmount = BigDecimal("30.00") - whenever(resourceProvider.getString(R.string.woopos_cash_payment_no_chang_due)) - .thenReturn("No Change Due") // WHEN viewModel.onUIEvent( @@ -124,7 +120,7 @@ class WooPosCashPaymentViewModelTest { assertThat(state).isInstanceOf(WooPosCashPaymentState.Collecting::class.java) val collectingState = state as WooPosCashPaymentState.Collecting assertThat(collectingState.enteredAmount).isEqualTo(enteredAmount) - assertThat(collectingState.changeDueText).isEqualTo("No Change Due") + assertThat(collectingState.changeDueText).isEqualTo("") assertThat(collectingState.button.status).isEqualTo(WooPosCashPaymentState.Collecting.Button.Status.DISABLED) }