fixed test that were broke when first tracking version was uploaded
@@ -10,7 +10,6 @@ import com.mercadopago.model.PaymentTypes;
import com.mercadopago.model.Token;
import com.mercadopago.viewmodel.CardPaymentModel;
import com.mercadopago.viewmodel.OneTapModel;
-import java.math.BigDecimal;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -51,9 +50,6 @@ public class OneTapPresenterTest {
@Mock
private CardPaymentMetadata cardMetadata;
- @Mock
- private BigDecimal transactionAmount;
-
private OneTapPresenter oneTapPresenter;
@Before
@@ -61,8 +57,6 @@ public class OneTapPresenterTest {
when(metadata.getCard()).thenReturn(cardMetadata);
when(model.getPaymentMethods()).thenReturn(paymentMethodSearch);
when(paymentMethodSearch.getOneTapMetadata()).thenReturn(metadata);
- when(model.getTransactionAmount()).thenReturn(transactionAmount);
-
oneTapPresenter = new OneTapPresenter(model);
oneTapPresenter.attachView(view);
}
@@ -72,6 +66,7 @@ public class OneTapPresenterTest {
cardConfig();
oneTapPresenter.confirmPayment();
verify(view).showCardFlow(model, card);
+ verify(view).trackConfirm(model);
verifyNoMoreInteractions(view);
}
@@ -79,7 +74,8 @@ public class OneTapPresenterTest {
public void whenConfirmPaymentPluginShowPaymentPluginFlow() {
configPlugin();
oneTapPresenter.confirmPayment();
- verify(view).showPaymentFlowPlugin(PaymentTypes.PLUGIN, PLUGIN_ID, transactionAmount);
+ verify(view).showPaymentFlowPlugin(PaymentTypes.PLUGIN, PLUGIN_ID);
+ verify(view).trackConfirm(model);
verifyNoMoreInteractions(view);
}
@@ -88,6 +84,7 @@ public class OneTapPresenterTest {
configOther();
oneTapPresenter.confirmPayment();
verify(view).showPaymentFlow(paymentMethod);
+ verify(view).trackConfirm(model);
verifyNoMoreInteractions(view);
}
@@ -130,6 +127,7 @@ public class OneTapPresenterTest {
public void onAmountShowMore() {
oneTapPresenter.onAmountShowMore();
verify(view).showDetailModal(model);
+ verify(view).trackModal(model);
verifyNoMoreInteractions(view);
}
}
\ No newline at end of file
