Skip to content

Commit

Permalink
Merge pull request #35 from likhith-deriv/likhith/74144/migrate-poi-b…
Browse files Browse the repository at this point in the history
…utton-to-tsx

likhith/migrate poi button component to TSX
  • Loading branch information
shayan-deriv authored Nov 21, 2022
2 parents 6021565 + 423b36d commit 521a61e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Verified } from '../verified';
jest.mock('Components/poa/continue-trading-button/continue-trading-button.jsx', () => ({
ContinueTradingButton: jest.fn(() => <div>ContinueTradingButton</div>),
}));
jest.mock('Components/poi/poi-button/poi-button.jsx', () => ({
jest.mock('Components/poi/poi-button/poi-button', () => ({
PoiButton: jest.fn(() => <div>PoiButton</div>),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PropTypes } from 'prop-types';
import { Icon } from '@deriv/components';
import { PlatformContext } from '@deriv/shared';
import { localize } from '@deriv/translations';
import { PoiButton } from 'Components/poi/poi-button/poi-button.jsx';
import { PoiButton } from 'Components/poi/poi-button/poi-button';
import IconMessageContent from 'Components/icon-message-content';
import { ContinueTradingButton } from 'Components/poa/continue-trading-button/continue-trading-button.jsx';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ describe('<PoiButton/>', () => {
it('should navigate to proof_of_identity page after clicking', () => {
renderWithRouter(<PoiButton />);
const poi_button = screen.getByText('Proof of identity');
expect(poi_button.closest('a')).toHaveAttribute('href', '/account/proof-of-identity');
const link = screen.getByRole('link', { current: false });
expect(link).toHaveAttribute('href', '/account/proof-of-identity');
fireEvent.click(poi_button);
expect(history.location.pathname).toBe('/account/proof-of-identity');
});
Expand Down
3 changes: 0 additions & 3 deletions packages/account/src/Components/poi/poi-button/index.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/account/src/Components/poi/poi-button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PoiButton } from './poi-button';

export default PoiButton;

0 comments on commit 521a61e

Please sign in to comment.