Skip to content

Commit

Permalink
Merge pull request #409 from ameerul-deriv/P2PS-4487-p2p-is-blocked-f…
Browse files Browse the repository at this point in the history
…or-wallet-user

Ameerul / P2PS-4487 P2P is blocked for Wallet User
  • Loading branch information
ameerul-deriv authored Nov 25, 2024
2 parents ce44bfc + 4caab1b commit 55af507
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
19 changes: 0 additions & 19 deletions src/components/BlockedScenarios/BlockedScenarios.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Chat from '@/utils/chat';
import {
DerivLightIcCashierBlockedIcon,
DerivLightIcCashierLockedIcon,
DerivLightIcCashierUnderMaintenanceIcon,
DerivLightWalletCurrencyUnavailableIcon as P2pUnavailable,
} from '@deriv/quill-icons';
Expand Down Expand Up @@ -34,24 +33,6 @@ const BlockedScenarios = ({ type }: { type: string }) => {
};

const blockedScenarios: TBlockedScenariosObject = {
cashierLocked: {
actionButton: (
<Button onClick={openLiveChat} size='lg' textSize={buttonTextSize}>
<Localize i18n_default_text='Live chat' />
</Button>
),
description: (
<Text align='center'>
<Localize i18n_default_text='Your cashier is currently locked. Please contact us via live chat to find out why.' />
</Text>
),
icon: <DerivLightIcCashierLockedIcon height={iconSize} width={iconSize} />,
title: (
<Text align='center' weight='bold'>
<Localize i18n_default_text='Cashier is locked' />
</Text>
),
},
crypto: {
actionButton: (
<Button onClick={openDerivApp} size='lg' textSize={buttonTextSize}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ describe('BlockedScenarios', () => {
expect(screen.getByRole('button', { name: 'Live chat' })).toBeInTheDocument();
});

it('should show the correct message for cashier locked account', () => {
render(<BlockedScenarios type='cashierLocked' />);
expect(screen.getByText('Cashier is locked')).toBeInTheDocument();
expect(
screen.getByText('Your cashier is currently locked. Please contact us via live chat to find out why.')
).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Live chat' })).toBeInTheDocument();
});

it('should show the correct message when cashier is under maintenance', () => {
render(<BlockedScenarios type='systemMaintenance' />);
expect(screen.getByText('Cashier is currently down for maintenance')).toBeInTheDocument();
Expand Down
10 changes: 0 additions & 10 deletions src/hooks/custom-hooks/__tests__/useIsP2PBlocked.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ describe('useIsP2PBlocked', () => {
expect(result.current).toStrictEqual({ isP2PBlocked: true, status: 'p2pBlocked' });
});

it('should return isP2PBlocked as true and status as cashierLocked if status has cashier_locked', () => {
mockUseGetAccountStatus.mockImplementation(() => ({
data: { p2p_status: 'none', status: ['cashier_locked'] },
}));
mockUseActiveAccount.mockImplementation(() => ({ data: { currency: 'USD', is_virtual: 0 } }));

const { result } = renderHook(() => useIsP2PBlocked());
expect(result.current).toStrictEqual({ isP2PBlocked: true, status: 'cashierLocked' });
});

it('should return isP2PBlocked as true and status as systemMaintenance if cashier_validation has system_maintenance', () => {
mockUseGetAccountStatus.mockImplementation(() => ({
data: { cashier_validation: ['system_maintenance'], p2p_status: 'none', status: [] },
Expand Down
1 change: 0 additions & 1 deletion src/hooks/custom-hooks/useIsP2PBlocked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const useIsP2PBlocked = () => {
if (!accountStatus) return '';

if (accountStatus?.cashier_validation?.includes('system_maintenance')) return 'systemMaintenance';
if (accountStatus.status.includes('cashier_locked')) return 'cashierLocked';
if (accountStatus.p2p_status === 'perm_ban') return 'p2pBlocked';

return '';
Expand Down

0 comments on commit 55af507

Please sign in to comment.