-
Notifications
You must be signed in to change notification settings - Fork 1
[PRMP-1326] Add Review Journey Remove All page #1024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| return ( | ||
| <> | ||
| <BackLink onClick={handleGoBack} data-testid="back-button"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back button component does this by default, should we use it here?
| it('renders the back link with correct text', () => { | ||
| render( | ||
| <ReviewDetailsDocumentRemoveAllStage | ||
| reviewData={mockReviewData} | ||
| documents={mockDocuments} | ||
| setDocuments={mockSetDocuments} | ||
| />, | ||
| ); | ||
|
|
||
| expect(screen.getByTestId('back-button')).toBeInTheDocument(); | ||
| expect(screen.getByText('Go back')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders DocumentUploadRemoveFilesStage component', () => { | ||
| render( | ||
| <ReviewDetailsDocumentRemoveAllStage | ||
| reviewData={mockReviewData} | ||
| documents={mockDocuments} | ||
| setDocuments={mockSetDocuments} | ||
| />, | ||
| ); | ||
|
|
||
| expect( | ||
| screen.getByRole('heading', { | ||
| name: 'Are you sure you want to remove all selected files?', | ||
| }), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders remove files button', () => { | ||
| render( | ||
| <ReviewDetailsDocumentRemoveAllStage | ||
| reviewData={mockReviewData} | ||
| documents={mockDocuments} | ||
| setDocuments={mockSetDocuments} | ||
| />, | ||
| ); | ||
|
|
||
| expect( | ||
| screen.getByRole('button', { name: 'Yes, remove all files' }), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders cancel button', () => { | ||
| render( | ||
| <ReviewDetailsDocumentRemoveAllStage | ||
| reviewData={mockReviewData} | ||
| documents={mockDocuments} | ||
| setDocuments={mockSetDocuments} | ||
| />, | ||
| ); | ||
|
|
||
| expect(screen.getByRole('button', { name: 'Cancel' })).toBeInTheDocument(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like this could be one test?
| documents={mockDocuments} | ||
| setDocuments={mockSetDocuments} | ||
| />, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the "renderApp" pattern that we use in other tests please
| </div> | ||
| </div> | ||
| )), | ||
| default: vi.fn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do these tests without mocking this component? Given that these components are a wrapper around the upload ones, we should probably test that it works when using the actual base component.
| expect(dashCell).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('allows removing additional documents but not review documents', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to check that a button for trying to remove review doc doesn't exist?
| it('renders the confirmation page with correct title', async () => { | ||
| render( | ||
| <DocumentUploadRemoveFilesStage | ||
| documents={documents} | ||
| setDocuments={() => {}} | ||
| setDocuments={mockSetDocuments} | ||
| documentType={DOCUMENT_TYPE.LLOYD_GEORGE} | ||
| />, | ||
| ); | ||
|
|
||
| await waitFor(async () => { | ||
| await waitFor(() => { | ||
| expect( | ||
| screen.getByText('Are you sure you want to remove all selected files?'), | ||
| ).toBeInTheDocument(); | ||
| }); | ||
| }); | ||
|
|
||
| it('renders remove files button', () => { | ||
| render( | ||
| <DocumentUploadRemoveFilesStage | ||
| documents={documents} | ||
| setDocuments={mockSetDocuments} | ||
| documentType={DOCUMENT_TYPE.LLOYD_GEORGE} | ||
| />, | ||
| ); | ||
|
|
||
| expect(screen.getByTestId('remove-files-button')).toBeInTheDocument(); | ||
| expect(screen.getByText('Yes, remove all files')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders cancel button', () => { | ||
| render( | ||
| <DocumentUploadRemoveFilesStage | ||
| documents={documents} | ||
| setDocuments={mockSetDocuments} | ||
| documentType={DOCUMENT_TYPE.LLOYD_GEORGE} | ||
| />, | ||
| ); | ||
|
|
||
| expect(screen.getByText('Cancel')).toBeInTheDocument(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be one test?
Code security issues foundView full details here. |
|



Overview
Jira ticket: PRMP-1326
Description
Context
review_jounrey_remove_all.webm
Checklist
Tasks for all changes:
I have run git pre-commits.(WIP)Deploy - Sandbox- workflow run - TBCSANDBOX Full- Deploy feature branch to sandbox- workflow run - TBCAdditional tasks for UI changes (delete if not applicable):
SANDBOX - UI Smoke Test- workflow run - TBC