Skip to content

Commit

Permalink
Navigate to new update PM screen when editing card brand from vertica…
Browse files Browse the repository at this point in the history
…l mode screen (#9742)
  • Loading branch information
amk-stripe authored Dec 4, 2024
1 parent aabba06 commit a976f15
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,11 @@ internal class DefaultPaymentMethodVerticalLayoutInteractor(
}
}
is ViewAction.EditPaymentMethod -> {
onEditPaymentMethod(viewAction.savedPaymentMethod)
if (FeatureFlags.useNewUpdateCardScreen.isEnabled) {
onUpdatePaymentMethod(viewAction.savedPaymentMethod)
} else {
onEditPaymentMethod(viewAction.savedPaymentMethod)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,21 @@ class DefaultPaymentMethodVerticalLayoutInteractorTest {
}
}

@Test
fun handleViewAction_OnEditPaymentMethod_transitionsToUpdateScreen_whenFeatureEnabled() {
var updatedPaymentMethod: DisplayableSavedPaymentMethod? = null
runScenario(
onUpdatePaymentMethod = {
updatedPaymentMethod = it
},
useNewUpdatePaymentMethodScreen = true,
) {
val paymentMethod = PaymentMethodFixtures.displayableCard()
interactor.handleViewAction(ViewAction.EditPaymentMethod(paymentMethod))
assertThat(updatedPaymentMethod).isEqualTo(paymentMethod)
}
}

@Test
fun handleViewAction_SelectSavedPaymentMethod_selectsSavedPm() {
val savedPaymentMethod = PaymentMethodFixtures.displayableCard()
Expand Down

0 comments on commit a976f15

Please sign in to comment.