-
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.
Merge branch 'develop' of github.com:binary-com/deriv-app into kate/8…
…0180/Update_DP2P_content_on_cashier_page
- Loading branch information
Showing
131 changed files
with
33,488 additions
and
84,208 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,6 @@ | ||
import POONotRequired from './poo-not-required'; | ||
import POOVerified from './poo-verified'; | ||
import POORejetced from './poo-rejected'; | ||
import POOSubmitted from './poo-submitted'; | ||
|
||
export { POONotRequired, POOVerified, POORejetced, POOSubmitted }; |
3 changes: 3 additions & 0 deletions
3
packages/account/src/Components/poo/statuses/poo-not-required/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { POONotRequired } from './not-required.jsx'; | ||
|
||
export default POONotRequired; |
18 changes: 18 additions & 0 deletions
18
packages/account/src/Components/poo/statuses/poo-not-required/not-required.jsx
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,18 @@ | ||
import { Icon } from '@deriv/components'; | ||
import { localize } from '@deriv/translations'; | ||
import React from 'react'; | ||
import IconMessageContent from 'Components/icon-message-content'; | ||
|
||
export const POONotRequired = () => { | ||
return ( | ||
<div className='proof-of-ownership__container'> | ||
<IconMessageContent | ||
message={localize("Your proof of ownership isn't required.")} | ||
text={localize( | ||
'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.' | ||
)} | ||
icon={<Icon icon='IcPooVerified' size={128} />} | ||
/> | ||
</div> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { POORejetced } from './rejected.jsx'; | ||
|
||
export default POORejetced; |
24 changes: 24 additions & 0 deletions
24
packages/account/src/Components/poo/statuses/poo-rejected/rejected.jsx
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 { Button, Text, Icon } from '@deriv/components'; | ||
import { localize } from '@deriv/translations'; | ||
import React from 'react'; | ||
|
||
export const POORejetced = ({ onTryAgain }) => { | ||
return ( | ||
<div className='proof-of-ownership__container'> | ||
<div className='proof-of-ownership__container--content'> | ||
<Icon className='icon' icon='IcPooRejected' size={128} /> | ||
<Text weight='bold'>{localize('Proof of ownership verification failed')}</Text> | ||
<Text size='xs'>{localize('We were unable to verify your proof of ownership.')}</Text> | ||
<Button | ||
type='button' | ||
className='proof-of-ownership__try-again-button' | ||
onClick={onTryAgain} | ||
large | ||
text={localize('Try again')} | ||
primary | ||
data-testid='dt_try-again-button' | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/account/src/Components/poo/statuses/poo-submitted/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { POOSubmitted } from './submitted.jsx'; | ||
|
||
export default POOSubmitted; |
16 changes: 16 additions & 0 deletions
16
packages/account/src/Components/poo/statuses/poo-submitted/submitted.jsx
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,16 @@ | ||
import { Icon } from '@deriv/components'; | ||
import { localize } from '@deriv/translations'; | ||
import React from 'react'; | ||
import IconMessageContent from 'Components/icon-message-content'; | ||
|
||
export const POOSubmitted = () => { | ||
return ( | ||
<div className='proof-of-ownership__container'> | ||
<IconMessageContent | ||
message={localize('We’ve received your proof of ownership.')} | ||
text={localize('We’ll review your documents and notify you of its status within 3 days.')} | ||
icon={<Icon icon='IcPooSubmitted' size={128} />} | ||
/> | ||
</div> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/account/src/Components/poo/statuses/poo-verified/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { POOVerified } from './verified.jsx'; | ||
|
||
export default POOVerified; |
15 changes: 15 additions & 0 deletions
15
packages/account/src/Components/poo/statuses/poo-verified/verified.jsx
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,15 @@ | ||
import { Icon } from '@deriv/components'; | ||
import { localize } from '@deriv/translations'; | ||
import React from 'react'; | ||
import IconMessageContent from 'Components/icon-message-content'; | ||
|
||
export const POOVerified = () => { | ||
return ( | ||
<div className='proof-of-ownership__container'> | ||
<IconMessageContent | ||
message={localize('Proof of ownership verification passed.')} | ||
icon={<Icon icon='IcPooVerified' size={128} />} | ||
/> | ||
</div> | ||
); | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/account/src/Components/sample-credit-card-modal/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { SampleCreditCardModal } from './sample-credit-card-modal.jsx'; | ||
|
||
export default SampleCreditCardModal; |
29 changes: 29 additions & 0 deletions
29
packages/account/src/Components/sample-credit-card-modal/sample-credit-card-modal.jsx
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,29 @@ | ||
import React from 'react'; | ||
import { Modal, Text } from '@deriv/components'; | ||
import { localize, Localize } from '@deriv/translations'; | ||
import { getUrlBase } from '@deriv/shared'; | ||
|
||
export const SampleCreditCardModal = ({ is_open, onClose }) => { | ||
return ( | ||
<Modal | ||
className='sample-credit-card-modal' | ||
is_open={is_open} | ||
should_header_stick_body | ||
title={<Localize i18n_default_text='How to mask your card?' />} | ||
toggleModal={onClose} | ||
> | ||
<React.Fragment> | ||
<Text className='sample-credit-card-modal-text' size='xs'> | ||
{localize( | ||
'Black out digits 7 to 12 of the card number that’s shown on the front of your debit/credit card.' | ||
)} | ||
</Text> | ||
<img | ||
src={getUrlBase('/public/images/common/sample-credit-card.png')} | ||
alt='creditcardsample' | ||
className='sample-credit-card-modal-img' | ||
/> | ||
</React.Fragment> | ||
</Modal> | ||
); | ||
}; |
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
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
19 changes: 19 additions & 0 deletions
19
packages/account/src/Sections/Verification/ProofOfOwnership/__test__/card.spec.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { fireEvent, render, screen } from '@testing-library/react'; | ||
import Card from '../card.jsx'; | ||
import React from 'react'; | ||
import { grouped_payment_method_data } from './test-data'; | ||
|
||
describe('card.jsx', () => { | ||
it('Should render a card', () => { | ||
render(<Card card={grouped_payment_method_data.visa} />); | ||
expect(screen.getByTestId(grouped_payment_method_data.visa.payment_method)).toBeInTheDocument(); | ||
}); | ||
it('Should render an expanded card on button click', () => { | ||
render(<Card card={grouped_payment_method_data.visa} />); | ||
const button = screen.getByTestId('dt_proof-of-ownership-button'); | ||
fireEvent.click(button); | ||
expect( | ||
screen.getAllByText('Accepted formats: pdf, jpeg, jpg, and png. Max file size: 8MB')[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
packages/account/src/Sections/Verification/ProofOfOwnership/__test__/expanded-card.spec.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import ExpandedCard from '../expanded-card.jsx'; | ||
import { grouped_payment_method_data } from './test-data.js'; | ||
|
||
describe('expanded-card.jsx', () => { | ||
it('should display correct identifier', () => { | ||
render( | ||
<ExpandedCard | ||
card_details={grouped_payment_method_data.visa} | ||
index={0} | ||
item_index={0} | ||
values={{ | ||
data: [ | ||
[ | ||
{ | ||
payment_method_identifier: '1234 56XX XXXX 1121', | ||
}, | ||
], | ||
], | ||
}} | ||
setFieldValue={jest.fn(() => {})} | ||
/> | ||
); | ||
const element = screen.getByDisplayValue('1234 56XX XXXX 1121'); | ||
expect(element).toBeInTheDocument(); | ||
}); | ||
it('should show example link for credit/debit card and render the correct identifier label', () => { | ||
render(<ExpandedCard card_details={grouped_payment_method_data.visa} />); | ||
const exampelLink = screen.getByText('See example'); | ||
expect(exampelLink).toBeInTheDocument(); | ||
const element = screen.getByText('Card number'); | ||
expect(element).toBeInTheDocument(); | ||
}); | ||
it('should render payment method link in the description', () => { | ||
render(<ExpandedCard card_details={grouped_payment_method_data.onlinenaira} />); | ||
const element = screen.getByText( | ||
'Upload a screenshot of your username on the General Information page at https://onlinenaira.com/members/index.htm' | ||
); | ||
expect(element).toBeInTheDocument(); | ||
}); | ||
}); |
53 changes: 53 additions & 0 deletions
53
...count/src/Sections/Verification/ProofOfOwnership/__test__/proof-of-ownership-form.spec.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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { fireEvent, render, screen } from '@testing-library/react'; | ||
import ProofOfOwnershipForm from '../proof-of-ownership-form.jsx'; | ||
import { grouped_payment_method_data } from './test-data'; | ||
|
||
describe('proof-of-ownership-form.jsx', () => { | ||
it('should render a single card item inside the form', () => { | ||
render( | ||
<ProofOfOwnershipForm | ||
grouped_payment_method_data={{ beyonic: grouped_payment_method_data.beyonic }} | ||
total_documents_required={1} | ||
updateAccountStatus={jest.fn()} | ||
refreshNotifications={jest.fn()} | ||
is_dark_mode={false} | ||
client_email={'test@testing.com'} | ||
/> | ||
); | ||
const cardItems = screen.getAllByRole('card-item'); | ||
expect(cardItems.length).toEqual(1); | ||
}); | ||
it('should render multiple card items inside the form', () => { | ||
render( | ||
<ProofOfOwnershipForm | ||
grouped_payment_method_data={grouped_payment_method_data} | ||
total_documents_required={7} | ||
updateAccountStatus={jest.fn()} | ||
refreshNotifications={jest.fn()} | ||
is_dark_mode={false} | ||
client_email={'test@testing.com'} | ||
/> | ||
); | ||
const cardItems = screen.getAllByRole('card-item'); | ||
expect(cardItems.length).toEqual(Object.keys(grouped_payment_method_data).length); | ||
}); | ||
it('should format identifier', async () => { | ||
render( | ||
<ProofOfOwnershipForm | ||
grouped_payment_method_data={{ visa: grouped_payment_method_data.visa }} | ||
updateAccountStatus={jest.fn()} | ||
refreshNotifications={jest.fn()} | ||
is_dark_mode={false} | ||
client_email={'test@testing.com'} | ||
/> | ||
); | ||
const poo_dropdown_button = await screen.findByTestId('dt_proof-of-ownership-button'); | ||
fireEvent.click(poo_dropdown_button); | ||
const identifier_input = await screen.findByTestId('dt_payment_method_identifier'); | ||
fireEvent.change(identifier_input, { target: { value: '1234567891011121' } }); | ||
fireEvent.blur(identifier_input); | ||
const element = screen.getByDisplayValue('1234 56XX XXXX 1121'); | ||
expect(element).toBeInTheDocument(); | ||
}); | ||
}); |
Oops, something went wrong.