Skip to content

Commit

Permalink
Update AvailableMT5AcountsList.spec.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
heorhi-deriv authored Nov 12, 2024
1 parent 65e5393 commit e8a90b2
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ describe('AvailableMT5AccountsList', () => {
expect(mockShow).toHaveBeenCalledWith(<TradingPlatformStatusModal isServerMaintenance={true} />);
});

it('shows MT5PasswordModal for non-regulated real accounts if client is verified', async () => {
it('shows MT5PasswordModal for non-regulated real accounts if client is verified', () => {
(useActiveWalletAccount as jest.Mock).mockReturnValue({
data: undefined,
});
// @ts-expect-error - since this is a mock, we only need partial properties of the account
render(<AvailableMT5AccountsList account={nonRegulatedAccount} />);

const button = screen.getByTestId('dt_wallets_trading_account_card');
await userEvent.click(button);
userEvent.click(button);

// @ts-expect-error - since this is a mock, we only need partial properties of the account
expect(mockShow).toHaveBeenCalledWith(<MT5PasswordModal account={nonRegulatedAccount} />);
});

it('shows ClientVerificationModal for regulated real accounts if client is unverified', async () => {
it('shows ClientVerificationModal for regulated real accounts if client is unverified', () => {
(useActiveWalletAccount as jest.Mock).mockReturnValue({
data: {
is_virtual: false,
Expand All @@ -151,13 +151,13 @@ describe('AvailableMT5AccountsList', () => {
render(<AvailableMT5AccountsList account={regulatedUnverifiedAccount} />);

const button = screen.getByTestId('dt_wallets_trading_account_card');
await userEvent.click(button);
userEvent.click(button);

// @ts-expect-error - since this is a mock, we only need partial properties of the account
expect(mockShow).toHaveBeenCalledWith(<ClientVerificationModal account={regulatedUnverifiedAccount} />);
});

it('shows MT5PasswordModal for demo accounts for verified clients', async () => {
it('shows MT5PasswordModal for demo accounts for verified clients', () => {
(useActiveWalletAccount as jest.Mock).mockReturnValue({
data: {
is_virtual: true,
Expand All @@ -167,7 +167,7 @@ describe('AvailableMT5AccountsList', () => {
render(<AvailableMT5AccountsList account={regulatedVerifiedAccount} />);

const button = screen.getByTestId('dt_wallets_trading_account_card');
await userEvent.click(button);
userEvent.click(button);

// @ts-expect-error - since this is a mock, we only need partial properties of the account
expect(mockShow).toHaveBeenCalledWith(<MT5PasswordModal account={regulatedVerifiedAccount} isVirtual={true} />);
Expand Down

0 comments on commit e8a90b2

Please sign in to comment.