Skip to content

Commit

Permalink
Merge pull request #28 from suisin-deriv/suisi/74142/ts_migration_idv…
Browse files Browse the repository at this point in the history
…_verified

Suisin/74142/ts migration idv verified
  • Loading branch information
shayan-deriv committed Nov 17, 2022
2 parents 5e5a946 + 4cf9e85 commit 8a6aea9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ describe('<IdvVerified />', () => {
expect(screen.getByText(submit_text)).toBeInTheDocument();
expect(history.location.pathname).not.toBe('/account/proof-of-address');
fireEvent.click(screen.getByText(submit_text));
expect(screen.getByRole('link', { name: submit_text }).closest('a')).toHaveAttribute(
'href',
'/account/proof-of-address'
);
expect(screen.getByRole('link', { name: submit_text })).toHaveAttribute('href', '/account/proof-of-address');
expect(history.location.pathname).toBe('/account/proof-of-address');
});

it('should render the IdvVerified component when needs_poa is false and is_from_external is true in mobile', () => {
isMobile.mockReturnValue(true);
(isMobile as jest.Mock).mockReturnValue(true);
renderWithRouter(<IdvVerified is_from_external />);
expect(screen.getByTestId('poi_idv_verified_container')).toBeInTheDocument();
expect(screen.getByText(/mockedsvgicon/i)).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { localize } from '@deriv/translations';
import PoaButton from 'Components/poa/poa-button';
import IdvDocumentVerified from 'Assets/ic-idv-verified.svg';

const IdvVerified = ({ needs_poa, is_from_external }) => {
type TIdvVerified = {
needs_poa: boolean;
is_from_external: boolean;
};

const IdvVerified = ({ needs_poa, is_from_external }: Partial<TIdvVerified>) => {
const header_Text = needs_poa
? localize('Your ID is verified. You will also need to submit proof of your address.')
: localize('ID verification passed');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import IdvVerified from './idv-verified.jsx';
import IdvVerified from './idv-verified';

export default IdvVerified;

0 comments on commit 8a6aea9

Please sign in to comment.