Skip to content

Commit

Permalink
Farzin/68320/Update cashier withdrawal locked status if PA already wi…
Browse files Browse the repository at this point in the history
…thdraw all his allowable withdrawal amount (#6032)

* fix(cashier): ✨ handle `PACommisionWithdrawalLimit` state in `CashierLocked`

* test(cashier): ✅ add test case to `CashierLocked` for `PACommisionWithdrawalLimit`

* Trigger Build
  • Loading branch information
farzin-deriv authored Sep 6, 2022
1 parent c13a0b0 commit 1a37dd2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,21 @@ describe('<CashierLocked />', () => {
)
).toBeInTheDocument();
});

it('should show the proper message if the client has PACommisionWithdrawalLimit', () => {
render(
<CashierLocked
account_status={{
cashier_validation: ['PACommisionWithdrawalLimit'],
}}
is_withdrawal_locked
/>
);

expect(
screen.getByText(
"It seems that you've no commissions to withdraw at the moment. You can make withdrawals once you receive your commissions."
)
).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const CashierLocked = ({
const ask_self_exclusion_max_turnover_set = cashier_validation?.includes('ASK_SELF_EXCLUSION_MAX_TURNOVER_SET');
const ask_fix_details = cashier_validation?.includes('ASK_FIX_DETAILS');
const ask_uk_funds_protection = cashier_validation?.includes('ASK_UK_FUNDS_PROTECTION');
const pa_commision_withdrawal_limit = cashier_validation?.includes('PACommisionWithdrawalLimit');

let icon = 'IcCashierLocked';
let title = localize('Cashier is locked');
let message = localize(
Expand Down Expand Up @@ -269,6 +271,12 @@ const CashierLocked = ({
icon = 'IcCashierWithdrawalLock';
title = localize('Withdrawals are locked');
message = localize('You can only make deposits. Please contact us via live chat for more information.');
} else if (is_withdrawal_locked && pa_commision_withdrawal_limit) {
icon = 'IcCashierWithdrawalLock';
title = localize('Cashier is locked for withdrawals');
message = localize(
"It seems that you've no commissions to withdraw at the moment. You can make withdrawals once you receive your commissions."
);
}

return (
Expand Down

1 comment on commit 1a37dd2

@vercel
Copy link

@vercel vercel bot commented on 1a37dd2 Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

binary.sx
deriv-app-git-master.binary.sx
deriv-app.vercel.app
deriv-app.binary.sx

Please sign in to comment.