forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amina/coj 737/duplicate document error fix (deriv-com#15635)
* feat: poa_account_settings * feat: duplicate document in mt5 poa * fix: component naming * fix: poi duplicate document * fix: cfd-poa * fix: test case * fix: test case fix * fix: constant value * fix: linting: * fix: typing * fix: removed step-idex undefined * fix: test case description * fix: remove back button in manual upload if resunbmission
- Loading branch information
1 parent
f58ca5f
commit b35b2c5
Showing
19 changed files
with
212 additions
and
94 deletions.
There are no files selected for viewing
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
13 changes: 8 additions & 5 deletions
13
packages/account/src/Components/poa/status/unverified/unverified.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
27 changes: 27 additions & 0 deletions
27
...count/src/Components/poi-manual-upload-failed/__tests__/poi-manual-upload-failed.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,27 @@ | ||
import React from 'react'; | ||
import { screen, render } from '@testing-library/react'; | ||
import POIManualUploadFailed from '../poi-manual-upload-failed'; | ||
|
||
jest.mock('@deriv/components', () => { | ||
const original_module = jest.requireActual('@deriv/components'); | ||
return { | ||
...original_module, | ||
Icon: jest.fn(() => <div>Mocked Icon</div>), | ||
}; | ||
}); | ||
|
||
describe('<POIManualUploadFailed />', () => { | ||
const error = 'MockAPIError'; | ||
it('should render <POIManualUploadFailed /> component with its default content', () => { | ||
render(<POIManualUploadFailed error={error} />); | ||
expect(screen.getByText('Proof of identity documents upload failed')).toBeInTheDocument(); | ||
expect(screen.getByText('MockAPIError')).toBeInTheDocument(); | ||
expect(screen.getByText('Mocked Icon')).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render <POIManualUploadFailed /> component with content from props', () => { | ||
render(<POIManualUploadFailed message='message' error={error} />); | ||
expect(screen.getByText('message')).toBeInTheDocument(); | ||
expect(screen.getByText('Mocked Icon')).toBeInTheDocument(); | ||
}); | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/account/src/Components/poi-manual-upload-failed/index.ts
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 POIManualUploadFailed from './poi-manual-upload-failed'; | ||
|
||
export default POIManualUploadFailed; |
21 changes: 21 additions & 0 deletions
21
packages/account/src/Components/poi-manual-upload-failed/poi-manual-upload-failed.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,21 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { Icon } from '@deriv/components'; | ||
import { Localize } from '@deriv/translations'; | ||
import IconMessageContent from '../icon-message-content'; | ||
|
||
type TPOIManualUploadFailed = { | ||
error: string; | ||
message?: ReactNode; | ||
}; | ||
const POIManualUploadFailed = ({ children, message, error }: React.PropsWithChildren<TPOIManualUploadFailed>) => ( | ||
<IconMessageContent | ||
message={message ?? <Localize i18n_default_text={'Proof of identity documents upload failed'} />} | ||
text={error} | ||
icon={<Icon icon='IcPoiFailed' size={128} />} | ||
className='account-management-dashboard' | ||
> | ||
{children} | ||
</IconMessageContent> | ||
); | ||
|
||
export default POIManualUploadFailed; |
21 changes: 0 additions & 21 deletions
21
packages/account/src/Components/poi-unsupported-failed/__tests__/unsupported-failed.spec.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/account/src/Components/poi-unsupported-failed/index.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
packages/account/src/Components/poi-unsupported-failed/unsupported-failed.tsx
This file was deleted.
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
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
Oops, something went wrong.