Skip to content

Commit

Permalink
yauheni / IdvNoSubmisssions test coverage (#5636)
Browse files Browse the repository at this point in the history
* yauheni / IdvNoSubmisssions test coverage

* imports fix

* naming typo fix

* Delete poi-idv-rejected.spec.js

Co-authored-by: “yauheni-kryzhyk-deriv” <“yauheni@deriv.me”>
Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 9, 2022
1 parent f75b15c commit 9f87a33
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import IdvNoSubmissions from '../poi-idv-limited';

jest.mock('../../../Assets/ic-idv-document-rejected.svg', () => jest.fn(() => 'IdvDocumentRejected'));

describe('<IdvNoSubmissions/>', () => {
const mockHandleRequireSubmission = jest.fn();

it('should render IdvNoSubmissions component and trigger click', () => {
render(<IdvNoSubmissions handleRequireSubmission={mockHandleRequireSubmission} />);

expect(screen.getByText('IdvDocumentRejected')).toBeInTheDocument();
expect(screen.getByText(/ID verification failed/i)).toBeInTheDocument();
expect(screen.getByText(/we were unable to verify your ID with the details you provided/i)).toBeInTheDocument();
expect(screen.getByText(/please upload your identity document/i)).toBeInTheDocument();

const btn = screen.getByRole('button');
expect(btn).toHaveTextContent(/upload identity document/i);
fireEvent.click(btn);
expect(mockHandleRequireSubmission).toHaveBeenCalledTimes(1);
});
});

1 comment on commit 9f87a33

@vercel
Copy link

@vercel vercel bot commented on 9f87a33 Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx
deriv-app.vercel.app

Please sign in to comment.