-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
henry/91713/test: Test coverage for POO statuses components (#8125)
* test: Test coverage for POO statuses components * fix: Empty-Commit --------- Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
- Loading branch information
1 parent
95fc0d1
commit eb7df52
Showing
6 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...ages/account/src/Components/poo/statuses/poo-not-required/__tests__/not-required.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/account/src/Components/poo/statuses/poo-rejected/__tests__/rejected.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
4 changes: 2 additions & 2 deletions
4
packages/account/src/Components/poo/statuses/poo-rejected/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/account/src/Components/poo/statuses/poo-submitted/__tests__/submitted.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/account/src/Components/poo/statuses/poo-verified/__tests__/verified.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
eb7df52
There was a problem hiding this comment.
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