Skip to content

Commit

Permalink
henry/91713/test: Test coverage for POO statuses components (#8125)
Browse files Browse the repository at this point in the history
* test: Test coverage for POO statuses components

* fix: Empty-Commit

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
  • Loading branch information
henry-deriv and ali-hosseini-deriv committed Jun 19, 2023
1 parent 95fc0d1 commit eb7df52
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { screen, render } from '@testing-library/react';
import React from 'react';
import POONotRequired from '../index';

jest.mock('@deriv/components', () => {
const original_module = jest.requireActual('@deriv/components');
return {
...original_module,
Icon: jest.fn(() => <div>Mocked Icon</div>),
};
});

describe('<POONotRequired />', () => {
it('should render <POONotRequired /> component with its content', () => {
render(<POONotRequired />);
expect(screen.getByText("Your proof of ownership isn't required.")).toBeInTheDocument();
expect(
screen.getByText(
'You are not required to submit proof of ownership at this time. We will inform you if proof of ownership is required in the future.'
)
).toBeInTheDocument();
expect(screen.getByText('Mocked Icon')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { screen, render } from '@testing-library/react';
import POORejected from '../index';

jest.mock('@deriv/components', () => {
const original_module = jest.requireActual('@deriv/components');
return {
...original_module,
Icon: jest.fn(() => <div>Mocked Icon</div>),
};
});

describe('<POORejected />', () => {
it('Should render <POORejected /> and its contents', () => {
const onTryAgain = jest.fn();
render(<POORejected onTryAgain={onTryAgain} />);
expect(screen.getByText('Mocked Icon')).toBeInTheDocument();
expect(screen.getByText('Proof of ownership verification failed')).toBeInTheDocument();
expect(screen.getByText('We were unable to verify your proof of ownership.')).toBeInTheDocument();
expect(screen.getByText('Try again')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { POORejetced } from './rejected.jsx';
import { POORejected } from './rejected.jsx';

export default POORejetced;
export default POORejected;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button, Text, Icon } from '@deriv/components';
import { localize } from '@deriv/translations';
import React from 'react';

export const POORejetced = ({ onTryAgain }) => {
export const POORejected = ({ onTryAgain }) => {
return (
<div className='proof-of-ownership__container'>
<div className='proof-of-ownership__container--content'>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { screen, render } from '@testing-library/react';
import POOSubmitted from '../index';

jest.mock('@deriv/components', () => {
const original_module = jest.requireActual('@deriv/components');
return {
...original_module,
Icon: jest.fn(() => <div>Mocked Icon</div>),
};
});

describe('<POOSubmitted />', () => {
it('Should render <POOSubmitted and its contents', () => {
render(<POOSubmitted />);
expect(screen.getByText('We’ve received your proof of ownership.')).toBeInTheDocument();
expect(
screen.getByText('We’ll review your documents and notify you of its status within 3 days.')
).toBeInTheDocument();
expect(screen.getByText('Mocked Icon')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { screen, render } from '@testing-library/react';
import POOVerified from '../index';

jest.mock('@deriv/components', () => {
const original_module = jest.requireActual('@deriv/components');
return {
...original_module,
Icon: jest.fn(() => <div>Mocked Icon</div>),
};
});

describe('<POOVerified />', () => {
it('Should render <POOVerified /> and its contents', () => {
render(<POOVerified />);
expect(screen.getByText('Proof of ownership verification passed.')).toBeInTheDocument();
expect(screen.getByText('Mocked Icon')).toBeInTheDocument();
});
});

1 comment on commit eb7df52

@vercel
Copy link

@vercel vercel bot commented on eb7df52 Jun 19, 2023

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 – ./

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

Please sign in to comment.