diff --git a/packages/cashier/src/Components/__tests__/payment-agent-list.spec.js b/packages/cashier/src/Components/__tests__/payment-agent-list.spec.js index 2cd5320b6aa3..f2b7c80ad918 100644 --- a/packages/cashier/src/Components/__tests__/payment-agent-list.spec.js +++ b/packages/cashier/src/Components/__tests__/payment-agent-list.spec.js @@ -1,9 +1,8 @@ import React from 'react'; -import { fireEvent, render, screen } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import PaymentAgentList from '../payment-agent-list'; import { createBrowserHistory } from 'history'; import { Router } from 'react-router'; -import { isMobile } from '@deriv/shared'; jest.mock('Stores/connect', () => ({ __esModule: true, @@ -14,6 +13,7 @@ jest.mock('Stores/connect', () => ({ jest.mock('Components/Error/error', () => () =>
PaymentAgentWithdrawError
); jest.mock('Components/Email/email-sent', () => () =>
The email has been sent!
); jest.mock('Components/Form/payment-agent-withdraw-form', () => () =>
Payment agent withdraw form
); +jest.mock('Components/Form/payment-agent-deposit', () => () =>
Payment agent deposit
); jest.mock('@deriv/components', () => ({ ...jest.requireActual('@deriv/components'), @@ -31,35 +31,7 @@ describe('', () => { is_loading: false, is_payment_agent_withdraw: false, payment_agent_active_tab_index: 0, - payment_agent_list: [ - { - email: 'mb+pa1@binary.com', - name: 'Ms QA script mbpaULOta', - phones: '+62417576632', - supported_banks: 'cash', - urls: 'https://www.payagent.com', - }, - { - email: 'pr+cr1@deriv.com', - name: 'Ms QA script prcrFDQ', - phones: '+62417597718', - supported_banks: 'paypal,hsbc', - urls: 'https://deriv.com/', - }, - { - email: 'pr+cr1@binary.com', - name: 'Ms QA script prcrfWn', - phones: '+62417511398', - supported_banks: 'paypal,hsbc', - urls: 'https://deriv.com/', - }, - ], - supported_banks: [ - { text: 'cash', value: 'cash' }, - { text: 'paypal', value: 'paypal' }, - ], verification_code: '', - onChangePaymentMethod: jest.fn(), onMount: jest.fn(), }; @@ -72,22 +44,7 @@ describe('', () => { it('should show proper messages, tabs and titles in Deposit tab', () => { renderWithRouter(); - expect( - screen.getByText( - 'A payment agent is authorised to process deposits and withdrawals for you if your local payment methods or currencies are not supported on Deriv.' - ) - ).toBeInTheDocument(); - expect( - screen.getAllByRole('listitem').find(listitem => listitem.textContent === 'Deposit') - ).toBeInTheDocument(); - expect( - screen.getAllByRole('listitem').find(listitem => listitem.textContent === 'Withdrawal') - ).toBeInTheDocument(); - expect(screen.getByText('Payment agents')).toBeInTheDocument(); - expect(screen.getByText('Choose a payment agent and contact them for instructions.')).toBeInTheDocument(); - expect(screen.getByText('Ms QA script mbpaULOta')).toBeInTheDocument(); - expect(screen.getByText('Ms QA script prcrFDQ')).toBeInTheDocument(); - expect(screen.getByText('Ms QA script prcrfWn')).toBeInTheDocument(); + expect(screen.getByText('Payment agent deposit')).toBeInTheDocument(); expect(screen.getByText('DISCLAIMER')).toBeInTheDocument(); expect( screen.getByText( @@ -102,20 +59,6 @@ describe('', () => { expect(screen.getByText('Loading')).toBeInTheDocument(); }); - it('should trigger onChange callback when the user selects payment agent from the list in Mobile mode', () => { - isMobile.mockReturnValue(true); - renderWithRouter(); - - const select_native = screen.getByRole('combobox'); - fireEvent.change(select_native, { - target: { - value: 'paypal', - }, - }); - - expect(props.onChangePaymentMethod).toHaveBeenCalledTimes(1); - }); - it('should show withdrawal error message in Withdrawal tab', () => { const error = { code: 'error code',