From 40604d0ec0cfb07d3151a22b786bfca5bb4293cd Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Thu, 28 May 2026 15:08:00 -0400 Subject: [PATCH] [PM-37804] fix: Drop redundant Stripe checkout confirmation on Upgrade Now (#6980) --- .../feature/premium/plan/PlanScreen.kt | 21 +------ .../feature/premium/plan/PlanScreenTest.kt | 60 ++----------------- 2 files changed, 5 insertions(+), 76 deletions(-) diff --git a/app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt b/app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt index 82d261e9ed..a0bdede28f 100644 --- a/app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt +++ b/app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreen.kt @@ -280,7 +280,6 @@ private fun FreeCloudContent( handlers: PlanHandlers, modifier: Modifier = Modifier, ) { - var shouldShowUpgradeDialog by rememberSaveable { mutableStateOf(false) } Column( modifier = modifier .fillMaxSize() @@ -300,29 +299,11 @@ private fun FreeCloudContent( // user to Premium. if (!viewState.isPremiumUpgradePending) { UpgradeNowCallToAction( - onUpgradeNowClick = { shouldShowUpgradeDialog = true }, + onUpgradeNowClick = handlers.onUpgradeNowClick, ) } Spacer(modifier = Modifier.navigationBarsPadding()) } - - if (shouldShowUpgradeDialog) { - BitwardenTwoButtonDialog( - title = stringResource(id = BitwardenString.continue_to_stripe), - message = stringResource( - id = BitwardenString - .youll_go_to_stripes_secure_checkout_to_complete_your_purchase, - ), - confirmButtonText = stringResource(id = BitwardenString.continue_text), - dismissButtonText = stringResource(id = BitwardenString.cancel), - onConfirmClick = { - shouldShowUpgradeDialog = false - handlers.onUpgradeNowClick() - }, - onDismissClick = { shouldShowUpgradeDialog = false }, - onDismissRequest = { shouldShowUpgradeDialog = false }, - ) - } } @Composable diff --git a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt index 5bdc95082c..0f17108f45 100644 --- a/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt +++ b/app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanScreenTest.kt @@ -137,66 +137,14 @@ class PlanScreenTest : BitwardenComposeTest() { } @Test - fun `upgrade now button click should show continue to Stripe confirmation dialog`() { - composeTestRule - .onAllNodesWithText("Continue to Stripe?") - .filterToOne(hasAnyAncestor(isDialog())) - .assertDoesNotExist() - + fun `upgrade now button click should send UpgradeNowClick action`() { composeTestRule .onNodeWithTag("UpgradeNowButton") .performScrollTo() .performClick() - - composeTestRule - .onAllNodesWithText("Continue to Stripe?") - .filterToOne(hasAnyAncestor(isDialog())) - .assertExists() - composeTestRule - .onAllNodesWithText( - "You’ll go to Stripe’s secure checkout to complete your purchase.", - ) - .filterToOne(hasAnyAncestor(isDialog())) - .assertExists() - verify(exactly = 0) { viewModel.trySendAction(PlanAction.UpgradeNowClick) } - } - - @Test - fun `upgrade now dialog continue click should send UpgradeNowClick action and dismiss`() { - composeTestRule - .onNodeWithTag("UpgradeNowButton") - .performScrollTo() - .performClick() - - composeTestRule - .onAllNodesWithText("Continue") - .filterToOne(hasAnyAncestor(isDialog())) - .performClick() - - verify { viewModel.trySendAction(PlanAction.UpgradeNowClick) } - composeTestRule - .onAllNodesWithText("Continue to Stripe?") - .filterToOne(hasAnyAncestor(isDialog())) - .assertDoesNotExist() - } - - @Test - fun `upgrade now dialog cancel click should dismiss without sending action`() { - composeTestRule - .onNodeWithTag("UpgradeNowButton") - .performScrollTo() - .performClick() - - composeTestRule - .onAllNodesWithText("Cancel") - .filterToOne(hasAnyAncestor(isDialog())) - .performClick() - - verify(exactly = 0) { viewModel.trySendAction(PlanAction.UpgradeNowClick) } - composeTestRule - .onAllNodesWithText("Continue to Stripe?") - .filterToOne(hasAnyAncestor(isDialog())) - .assertDoesNotExist() + verify { + viewModel.trySendAction(PlanAction.UpgradeNowClick) + } } @Test