diff --git a/ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx b/ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx index e005da7d6ed..abb656c84be 100644 --- a/ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx +++ b/ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx @@ -44,6 +44,7 @@ import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel"; import { getPaymentsLatestBizEventsTransactionsAction } from "../../bizEventsTransaction/store/actions"; import { usePaymentReversedInfoBottomSheet } from "../hooks/usePaymentReversedInfoBottomSheet"; import { WalletPaymentStepEnum } from "../types"; +import { requestAppReview } from "../../../../utils/storeReview"; type WalletPaymentOutcomeScreenNavigationParams = { outcome: WalletPaymentOutcome; @@ -146,6 +147,11 @@ const WalletPaymentOutcomeScreen = () => { navigation.pop(); }; + const handleSuccessClose = () => { + requestAppReview(); + handleClose(); + }; + const handleShowMoreOnReversedPayment = () => { reversedPaymentModal.present(); }; @@ -153,7 +159,7 @@ const WalletPaymentOutcomeScreen = () => { const closeSuccessAction: OperationResultScreenContentProps["action"] = { label: I18n.t("wallet.payment.outcome.SUCCESS.button"), accessibilityLabel: I18n.t("wallet.payment.outcome.SUCCESS.button"), - onPress: handleClose, + onPress: handleSuccessClose, testID: "wallet-payment-outcome-success-button" }; diff --git a/ts/features/payments/checkout/screens/___tests___/WalletPaymentOutcomeScreen.test.tsx b/ts/features/payments/checkout/screens/___tests___/WalletPaymentOutcomeScreen.test.tsx index 74a5619e232..81a824ca0f1 100644 --- a/ts/features/payments/checkout/screens/___tests___/WalletPaymentOutcomeScreen.test.tsx +++ b/ts/features/payments/checkout/screens/___tests___/WalletPaymentOutcomeScreen.test.tsx @@ -10,6 +10,11 @@ import { WalletPaymentOutcomeEnum } from "../../types/PaymentOutcomeEnum"; import { getPaymentsLatestBizEventsTransactionsAction } from "../../../bizEventsTransaction/store/actions"; import * as useIO from "../../../../../store/hooks"; +jest.mock("react-native-store-review", () => ({ + isAvailable: jest.fn().mockReturnValue(true), + requestReview: jest.fn() +})); + const renderComponent = (outcome: WalletPaymentOutcomeEnum) => { const globalState = appReducer(undefined, applicationChangeState("active"));