Skip to content

Commit

Permalink
test: change from regex to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Hein authored and Henry Hein committed Mar 28, 2023
1 parent 8525051 commit 9e71ae4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import { screen, render } from '@testing-library/react';
import PoaNotRequired from '..';

jest.mock('@deriv/components', () => {
const original_module = jest.requireActual('@deriv/components');
return {
...original_module,
Icon: jest.fn(() => <div>Mocked Icon</div>),
};
});

describe('<PoaNotRequired />', () => {
it('should render <PoaNotRequired /> component with its content', () => {
render(<PoaNotRequired />);
expect(screen.getByText('Proof of address verification not required')).toBeInTheDocument();
expect(
screen.getByText(
'Your account does not need address verification at this time. We will inform you if address verification is required in the future.'
)
).toBeInTheDocument();
expect(screen.getByText('Mocked Icon')).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ describe('<UnsupportedFailed />', () => {
const error = 'error';
it('should render <UnsupportedFailed /> component with its content', () => {
render(<UnsupportedFailed error={error} />);
expect(screen.getByText(/proof of identity documents upload failed/i)).toBeInTheDocument();
expect(screen.getByText(/error/i)).toBeInTheDocument();
expect(screen.getByText(/mocked icon/i)).toBeInTheDocument;
expect(screen.getByText('Proof of identity documents upload failed')).toBeInTheDocument();
expect(screen.getByText('error')).toBeInTheDocument();
expect(screen.getByText('Mocked Icon')).toBeInTheDocument;
});
});

0 comments on commit 9e71ae4

Please sign in to comment.