diff --git a/packages/account/src/Components/poi-idv-limited/__tests__/poi-idv-limited.spec.js b/packages/account/src/Components/poi-idv-limited/__tests__/poi-idv-limited.spec.js new file mode 100644 index 000000000000..fd6bf31b11aa --- /dev/null +++ b/packages/account/src/Components/poi-idv-limited/__tests__/poi-idv-limited.spec.js @@ -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('', () => { + const mockHandleRequireSubmission = jest.fn(); + + it('should render IdvNoSubmissions component and trigger click', () => { + render(); + + 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); + }); +});