Skip to content
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

PRMDR-769 - Deletion Journey #364

Merged
merged 32 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f219ded
Add remove record stage
RioKnightleyNHS May 8, 2024
c1b6f89
Add remove files stage
RioKnightleyNHS May 8, 2024
2b47c7b
Add remove files view
RioKnightleyNHS May 8, 2024
f2c5695
Standardise remove stages
RioKnightleyNHS May 8, 2024
3350da2
Fix unit tests for patient info
RioKnightleyNHS May 9, 2024
6c9dedf
Add remove record stage results
RioKnightleyNHS May 9, 2024
d100b12
Add real results render
RioKnightleyNHS May 9, 2024
6ed2e50
Update progress bar
RioKnightleyNHS May 10, 2024
94868a7
change remove state components
RioKnightleyNHS May 10, 2024
31e2b21
Update spacing styleguide
RioKnightleyNHS May 10, 2024
e35d03e
more style
RioKnightleyNHS May 10, 2024
836ded0
change order of style
RioKnightleyNHS May 10, 2024
0d1233c
typo in style
RioKnightleyNHS May 10, 2024
a6473ee
Add new unit test for remove stage
RioKnightleyNHS May 15, 2024
9615f59
Add all rendering tests
RioKnightleyNHS May 16, 2024
6c21371
Add navigation tests
RioKnightleyNHS May 16, 2024
3080c43
Remove unused variables
RioKnightleyNHS May 16, 2024
d7807a6
Fix cypress tests
RioKnightleyNHS May 16, 2024
959480a
Fix session reset tests
RioKnightleyNHS May 16, 2024
61d1228
cypress test updates inline with changes
May 20, 2024
4502d71
retention period link added to warning message
May 20, 2024
1656c6b
merged with main, conflicts resolved
May 20, 2024
8786468
test conflict on component following merge
May 21, 2024
fa41e0e
updated lg deletion completion page inline with ticket description
May 21, 2024
eb221c6
implemented the Warning component for the delete warning.
May 21, 2024
cdb0bdd
merged with main
May 21, 2024
1b09e4f
jest and cypress test fixes following delete completion page modifica…
May 21, 2024
e49af69
fixed unused import build error
May 21, 2024
d58d0db
testing new intercepts on LG delete workflow cypress tests
May 21, 2024
9e14c99
added space between link and text on removeRecord.tsx
May 22, 2024
a816358
merged with main and resolved conflicts
May 22, 2024
c5ec403
ensured the SimpleSummary has a unique filename and fixed cypress bui…
May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,30 @@ describe('GP Workflow: View Lloyd George record', () => {
request = request + 1;
}).as('lloydGeorgeStitch');

cy.intercept('GET', '/SearchDocumentReferences*', {
statusCode: 200,
body: [
{
fileName: 'testName',
created: 'testCreated',
virusScannerResult: 'Clean',
},
],
}).as('searchDocs');

cy.get('#verify-submit').click();
cy.wait('@lloydGeorgeStitch');

cy.getByTestId('delete-all-files-link').should('exist');
cy.getByTestId('delete-all-files-link').click();

cy.wait('@searchDocs');
// assert delete confirmation page is as expected
cy.contains('Are you sure you want to permanently delete files for:').should(
'be.visible',
);
cy.contains('GivenName Surname').should('be.visible');
cy.getByTestId('remove-record-warning-text').should('be.visible');

cy.getByTestId('remove-btn').click();
cy.contains('Surname').should('be.visible');
cy.contains('GivenName').should('be.visible');
cy.contains('NHS number: 900 000 0009').should('be.visible');
cy.contains('Date of birth: 01 January 1970').should('be.visible');

Expand All @@ -242,16 +255,14 @@ describe('GP Workflow: View Lloyd George record', () => {
},
).as('documentDelete');

cy.getByTestId('yes-radio-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#yes-radio-button').click();
cy.getByTestId('delete-submit-btn').click();

cy.wait('@documentDelete');

// assert delete success page is as expected
cy.contains('Deletion complete').should('be.visible');
cy.contains(
'You have successfully deleted 12 file(s) from the Lloyd George record of:',
).should('be.visible');
cy.getByTestId('deletion-complete_card_content_header').should('be.visible');
cy.contains('GivenName Surname').should('be.visible');
cy.contains(
`NHS number: ${formatNhsNumber(searchPatientPayload.nhsNumber)}`,
Expand Down Expand Up @@ -283,8 +294,7 @@ describe('GP Workflow: View Lloyd George record', () => {
cy.getByTestId('delete-all-files-link').should('exist');
cy.getByTestId('delete-all-files-link').click();
// cancel delete
cy.getByTestId('no-radio-btn').click();
cy.getByTestId('delete-submit-btn').click();
cy.getByTestId('start-again-btn').click();

// assert user is returned to view Lloyd George page
cy.contains('Lloyd George record').should('be.visible');
Expand All @@ -304,11 +314,16 @@ describe('GP Workflow: View Lloyd George record', () => {
body: viewLloydGeorgePayload,
}).as('lloydGeorgeStitch');

cy.get('#verify-submit').click();
cy.wait('@lloydGeorgeStitch');

cy.getByTestId('delete-all-files-link').should('exist');
cy.getByTestId('delete-all-files-link').click();
cy.intercept('GET', '/SearchDocumentReferences*', {
statusCode: 200,
body: [
{
fileName: 'testName',
created: 'testCreated',
virusScannerResult: 'Clean',
},
],
}).as('searchDocs');

cy.intercept(
'DELETE',
Expand All @@ -319,9 +334,18 @@ describe('GP Workflow: View Lloyd George record', () => {
},
).as('documentDelete');

cy.getByTestId('yes-radio-btn').click();
cy.getByTestId('delete-submit-btn').click();
cy.get('#verify-submit').click();
cy.wait('@lloydGeorgeStitch');

cy.getByTestId('delete-all-files-link').should('exist');
cy.getByTestId('delete-all-files-link').click();

cy.wait('@searchDocs');

cy.getByTestId('remove-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#yes-radio-button').click();
cy.getByTestId('delete-submit-btn').click();
cy.wait('@documentDelete');

// assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ describe('PCSE Workflow: Access and download found files', () => {
navigateToDownload();

cy.get('#download-page-title').should('have.length', 1);
cy.get('#patient-summary-nhs-number').should('have.text', patient.nhsNumber);
cy.get('#patient-summary-family-name').should('have.text', patient.familyName);
cy.get('#patient-details-nhs-number').should('have.text', patient.nhsNumber);
cy.get('#patient-details-family-name').should('have.text', patient.familyName);

const givenName = patient.givenName[0];
cy.get('#patient-summary-given-name').should('have.text', givenName + ' ');
cy.get('#patient-summary-date-of-birth').should(
cy.get('#patient-details-given-name').should('have.text', givenName + ' ');
cy.get('#patient-details-date-of-birth').should(
'have.text',
patient.birthDate.toLocaleDateString('en-GB', {
day: '2-digit',
month: 'long',
year: 'numeric',
}),
);
cy.get('#patient-summary-postcode').should('have.text', patient.postalCode);
cy.get('#patient-details-postcode').should('have.text', patient.postalCode);
});

it('shows no files avaliable on 204 success', { tags: 'regression' }, () => {
Expand Down Expand Up @@ -257,16 +257,14 @@ describe('PCSE Workflow: Access and download found files', () => {

cy.getByTestId('delete-all-documents-btn').click();

cy.getByTestId('yes-radio-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#yes-radio-button').click();
cy.getByTestId('delete-submit-btn').click();

cy.wait('@documentDelete');

// assert delete success page is as expected
cy.contains('Deletion complete').should('be.visible');
cy.contains('You have successfully deleted 2 file(s) from the record of:').should(
'be.visible',
);
cy.getByTestId('deletion-complete_card_content_header').should('be.visible');
cy.contains('GivenName Surname').should('be.visible');
cy.contains(
`NHS number: ${formatNhsNumber(searchPatientPayload.nhsNumber)}`,
Expand All @@ -280,8 +278,8 @@ describe('PCSE Workflow: Access and download found files', () => {
() => {
cy.getByTestId('delete-all-documents-btn').click();

// cancel delete
cy.getByTestId('no-radio-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#no-radio-button').click();
cy.getByTestId('delete-submit-btn').click();

// assert user is returned to download documents page
Expand All @@ -306,7 +304,8 @@ describe('PCSE Workflow: Access and download found files', () => {

cy.getByTestId('delete-all-documents-btn').click();

cy.getByTestId('yes-radio-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#yes-radio-button').click();
cy.getByTestId('delete-submit-btn').click();

// assert
Expand All @@ -329,7 +328,8 @@ describe('PCSE Workflow: Access and download found files', () => {

cy.getByTestId('delete-all-documents-btn').click();

cy.getByTestId('yes-radio-btn').click();
cy.get('#delete-docs').should('be.visible');
cy.get('#yes-radio-button').click();
cy.getByTestId('delete-submit-btn').click();

// assert
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/blocks/_arf/selectStage/SelectStage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { Button, Fieldset } from 'nhsuk-react-components';
import { useController, useForm } from 'react-hook-form';
import toFileList from '../../../../helpers/utils/toFileList';
import PatientSummary from '../../../generic/patientSummary/PatientSummary';
import PatientDetails from '../../../generic/patientDetails/PatientDetails';
import DocumentInputForm from '../documentInputForm/DocumentInputForm';
import { ARFFormConfig } from '../../../../helpers/utils/formConfig';
import { v4 as uuidv4 } from 'uuid';
Expand Down Expand Up @@ -165,7 +165,7 @@ function SelectStage({ setDocuments, setStage, documents }: Props) {
<Fieldset.Legend headingLevel="h1" isPageHeading>
Upload documents
</Fieldset.Legend>
<PatientSummary />
<PatientDetails />

<Fieldset>
<h2>Electronic health records</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import formatFileSize from '../../../../helpers/utils/formatFileSize';
import { getFormattedDate } from '../../../../helpers/utils/formatDate';
import ErrorBox from '../../../layout/errorBox/ErrorBox';
import PatientSummary from '../../../generic/patientSummary/PatientSummary';
import PatientDetails from '../../../generic/patientDetails/PatientDetails';
import useTitle from '../../../../helpers/hooks/useTitle';

export interface Props {
Expand Down Expand Up @@ -117,7 +117,7 @@ const UploadSummary = ({ documents }: Props) => {
</Details.Text>
</Details>
)}
<PatientSummary />
<PatientDetails />

<WarningCallout style={{ marginTop: 75 }} id="close-page-warning">
<WarningCallout.Label>Before you close this page</WarningCallout.Label>
Expand Down
Loading
Loading