Skip to content

Commit

Permalink
PRMP-1258 Removes start again link from download lloyd george page (#468
Browse files Browse the repository at this point in the history
)

* removes start again link from download lloyd george page

* removes unnessecary imports

* Delete app/.env copy.template

---------

Co-authored-by: Jack Sutton <[email protected]>
  • Loading branch information
jack-nhs and SuttonMashing authored Nov 27, 2024
1 parent bc9efaa commit d4667ad
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ describe('GP Workflow: View Lloyd George record', () => {
cy.getByTestId('download-selected-files-btn').should('exist');
cy.getByTestId('toggle-selection-btn').should('exist');

cy.getByTestId('start-again-link').should('exist');
cy.getByTestId('toggle-selection-btn').click();
cy.getByTestId('download-selected-files-btn').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ describe('LloydGeorgeSelectDownloadStage', () => {
});
expect(screen.getByTestId('search-result-0')).toBeInTheDocument();
expect(screen.getByTestId('download-selected-files-btn')).toBeInTheDocument();
expect(screen.getByTestId('start-again-link')).toBeInTheDocument();
expect(screen.getByTestId('toggle-selection-btn')).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ describe('LloydGeorgeSelectSearchResults', () => {
expect(screen.getByTestId('patient-summary')).toBeInTheDocument();
expect(screen.getByTestId('download-selected-files-btn')).toBeInTheDocument();
expect(screen.getByTestId('toggle-selection-btn')).toBeInTheDocument();
expect(screen.getByTestId('start-again-link')).toBeInTheDocument();
});

it('shows error box when download selected files button is clicked but no files selected', async () => {
Expand Down Expand Up @@ -293,16 +292,6 @@ describe('LloydGeorgeSelectSearchResults', () => {
});

describe('Navigation', () => {
it('navigates to start page when user clicks on start again link', () => {
renderComponent();

act(() => {
userEvent.click(screen.getByRole('link', { name: 'Start again' }));
});

expect(mockNavigate).toHaveBeenCalledWith(routes.START);
});

it('sets submission state when download selected files button is clicked and not all files selected', () => {
renderComponent();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button, Checkboxes, Table } from 'nhsuk-react-components';
import { SearchResult } from '../../../../types/generic/searchResult';
import { getFormattedDatetime } from '../../../../helpers/utils/formatDatetime';
import { Link, useNavigate } from 'react-router-dom';
import { routeChildren, routes } from '../../../../types/generic/routes';
import { useNavigate } from 'react-router-dom';
import { routeChildren } from '../../../../types/generic/routes';
import React, { Dispatch, ReactNode, SetStateAction, SyntheticEvent, useState } from 'react';
import { SEARCH_AND_DOWNLOAD_STATE } from '../../../../types/pages/documentSearchResultsPage/types';
import ErrorBox from '../../../layout/errorBox/ErrorBox';
Expand Down Expand Up @@ -231,17 +231,6 @@ const LloydGeorgeSelectSearchResults = ({
Download
</Button>
)}
<Link
id="start-again-link"
data-testid="start-again-link"
to=""
onClick={(e) => {
e.preventDefault();
navigate(routes.START);
}}
>
Start again
</Link>
</div>
</>
);
Expand Down

0 comments on commit d4667ad

Please sign in to comment.