Skip to content

Commit

Permalink
Merge pull request binary-com#17 from suisin-deriv/suisin/74137/ts_mi…
Browse files Browse the repository at this point in the history
…gration_idv_expired_and_test

Sui Sin/ts migration for idv expired
  • Loading branch information
shayan-deriv committed Nov 20, 2022
2 parents 602bc87 + 781767b commit af8bc9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { screen, render, fireEvent } from '@testing-library/react';
import { Icon } from '@deriv/components';
import { isDesktop, isMobile } from '@deriv/shared';
import IdvExpired from '../idv-expired';

Expand All @@ -19,8 +18,8 @@ jest.mock('@deriv/shared', () => ({
}));

beforeEach(() => {
isDesktop.mockReturnValue(true);
isMobile.mockReturnValue(false);
(isDesktop as jest.Mock).mockReturnValue(true);
(isMobile as jest.Mock).mockReturnValue(false);
jest.clearAllMocks();
});

Expand All @@ -41,8 +40,8 @@ describe('<IdvExpired/>', () => {
});

it('should render IdvExpired component on mobile', () => {
isDesktop.mockReturnValue(false);
isMobile.mockReturnValue(true);
(isDesktop as jest.Mock).mockReturnValue(false);
(isMobile as jest.Mock).mockReturnValue(true);
testComponentRender();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { Button, Icon, Text } from '@deriv/components';
import { isMobile } from '@deriv/shared';
import { localize } from '@deriv/translations';

const IdvExpired = ({ handleRequireSubmission }) => {
type TIdvExpired = {
handleRequireSubmission: () => void;
};

const IdvExpired = ({ handleRequireSubmission }: TIdvExpired) => {
return (
<div className='proof-of-identity__container' data-testid='idv_expired_container'>
<Icon icon='IcPoiFailed' className='icon' size={128} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import IdvExpired from './idv-expired.jsx';
import IdvExpired from './idv-expired';

export default IdvExpired;

0 comments on commit af8bc9d

Please sign in to comment.