Skip to content

Commit

Permalink
Update unit test to test venmo and control type button
Browse files Browse the repository at this point in the history
  • Loading branch information
warmkesselj committed Dec 17, 2024
1 parent 2900826 commit c51062b
Showing 1 changed file with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ class ShopperInsightsClientUnitTest {
}

@Test
fun `test paypal presented analytics event`() {
fun `test paypal button presented analytics event`() {

// A Test type, with a button in the first position displayed in the mini cart.
val presentmentDetails = PresentmentDetails(
ExperimentType.TEST,
ButtonOrder.FIRST,
Expand All @@ -462,6 +464,34 @@ class ShopperInsightsClientUnitTest {
params) }
}

@Test
fun `test venmo button presented analytics event`() {

// A Control type, with a button in the second position displayed on the homepage.
val presentmentDetails = PresentmentDetails(
ExperimentType.CONTROL,
ButtonOrder.SECOND,
PageType.HOMEPAGE
)

val params = AnalyticsEventParams(
experiment = presentmentDetails?.type?.formattedExperiment(),
shopperSessionId = shopperSessionId,
buttonType = ButtonType.VENMO.toString(),
buttonOrder = presentmentDetails?.buttonOrder.toString()
)
sut.sendPresentedEvent(
ButtonType.VENMO,
PresentmentDetails(
ExperimentType.CONTROL,
ButtonOrder.SECOND,
PageType.HOMEPAGE
)
)
verify { braintreeClient.sendAnalyticsEvent("shopper-insights:button-presented",
params) }
}

@Test
fun `test paypal selected analytics event`() {
sut.sendPayPalSelectedEvent()
Expand Down

0 comments on commit c51062b

Please sign in to comment.