diff --git a/ts/features/payments/checkout/components/WalletPspListSkeleton.tsx b/ts/features/payments/checkout/components/WalletPspListSkeleton.tsx index 4d94bbbed9b..c9bcd3e3511 100644 --- a/ts/features/payments/checkout/components/WalletPspListSkeleton.tsx +++ b/ts/features/payments/checkout/components/WalletPspListSkeleton.tsx @@ -9,13 +9,13 @@ import { View } from "react-native"; import Placeholder from "rn-placeholder"; export const WalletPspListSkeleton = () => ( - <> + - + ); type PspSkeletonProps = { diff --git a/ts/features/payments/checkout/hooks/___tests___/useSortPspBottomSheet.test.tsx b/ts/features/payments/checkout/hooks/___tests___/useSortPspBottomSheet.test.tsx new file mode 100644 index 00000000000..36c3011cac5 --- /dev/null +++ b/ts/features/payments/checkout/hooks/___tests___/useSortPspBottomSheet.test.tsx @@ -0,0 +1,77 @@ +import { fireEvent, render } from "@testing-library/react-native"; +import React from "react"; +import { Button, Text } from "react-native"; +import { WalletPaymentPspSortType } from "../../types"; +import { useSortPspBottomSheet } from "../useSortPspBottomSheet"; + +// Mock bottom sheet hook +jest.mock("../../../../../utils/hooks/bottomSheet", () => ({ + useIOBottomSheetAutoresizableModal: jest.fn().mockReturnValue({ + isVisible: false, + show: jest.fn(), + hide: jest.fn() + }) +})); + +// Test component to render and use the hook +const ComponentWithPspBottomSheet = ({ + onSortChange +}: { + onSortChange: (sortType: WalletPaymentPspSortType) => void; +}) => { + const { sortType, dismiss, present } = useSortPspBottomSheet({ + onSortChange + }); + + return ( + <> + {sortType} +