Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -155,23 +155,20 @@ const createMockUploadDocuments = (): ReviewUploadDocument[] => [
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
{
id: 'new-2',
file: new File(['test content 2'], 'new-file-2.pdf', { type: 'application/pdf' }),
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
{
id: 'existing-1',
file: new File(['existing content'], 'existing-file-1.pdf', { type: 'application/pdf' }),
type: UploadDocumentType.EXISTING,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
];

Expand Down Expand Up @@ -488,7 +485,6 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
{
id: 'new-2',
Expand All @@ -498,7 +494,6 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
];

Expand Down Expand Up @@ -552,7 +547,6 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.EXISTING,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
{
id: 'existing-2',
Expand All @@ -562,7 +556,6 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.EXISTING,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '16521000000101' as DOCUMENT_TYPE,
attempts: 0,
},
];

Expand Down Expand Up @@ -964,7 +957,6 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '24511000000107' as DOCUMENT_TYPE,
attempts: 0,
},
];

Expand Down Expand Up @@ -1021,15 +1013,13 @@ describe('ReviewDetailsAssessmentStage', () => {
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '24511000000107' as DOCUMENT_TYPE,
attempts: 0,
},
{
id: 'new-2',
file: new File(['test content 2'], 'file-2.pdf', { type: 'application/pdf' }),
type: UploadDocumentType.REVIEW,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
docType: '24511000000107' as DOCUMENT_TYPE,
attempts: 0,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('ReviewDetailsCompletePage', () => {
file: mockFile,
id: 'test-id-1',
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 1,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ describe('ReviewDetailsDocumentRemoveAllStage', () => {
progress: 0,
docType: testReviewSnoMed,
type: UploadDocumentType.REVIEW,
attempts: 0,
};

const mockAdditionalDocument: ReviewUploadDocument = {
Expand All @@ -54,7 +53,6 @@ describe('ReviewDetailsDocumentRemoveAllStage', () => {
progress: 0,
docType: testReviewSnoMed,
type: undefined,
attempts: 0,
};

const mockDocuments: ReviewUploadDocument[] = [mockReviewDocument, mockAdditionalDocument];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ vi.mock('../../_documentManagement/documentSelectOrderStage/DocumentSelectOrderS
state: 'SELECTED',
progress: 0,
docType: 'LLOYD_GEORGE',
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -89,7 +88,6 @@ describe('ReviewDetailsDocumentSelectOrderStage', () => {
state: 'SELECTED',
progress: 0,
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 0,
numPages: 1,
validated: false,
} as UploadDocument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -154,7 +153,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand All @@ -179,7 +177,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -208,7 +205,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -254,7 +250,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -292,7 +287,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down Expand Up @@ -334,7 +328,6 @@ describe('ReviewDetailsDocumentSelectStage', () => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: testReviewSnomed,
attempts: 0,
numPages: 1,
validated: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ describe('ReviewDetailsDocumentUploadingStage', (): void => {
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 0,
type: UploadDocumentType.REVIEW,
ref: 'test-ref-1',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const ReviewDetailsDocumentUploadingStage = ({
state: DOCUMENT_UPLOAD_STATE.SELECTED,
progress: 0,
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 0,
type: UploadDocumentType.REVIEW,
blob: fileBlob,
versionId: existing?.versionId,
Expand Down Expand Up @@ -225,7 +224,8 @@ const ReviewDetailsDocumentUploadingStage = ({
const startUpload = async (): Promise<void> => {
try {
const uploadSession: UploadSession = await getUploadSession(
patientDetails!,
true,
patientDetails!.nhsNumber,
baseUrl,
baseHeaders,
existingId,
Expand All @@ -246,7 +246,8 @@ const ReviewDetailsDocumentUploadingStage = ({
setInterval,
documents,
setDocuments,
patientDetails!,
true,
patientDetails!.nhsNumber,
baseUrl,
baseHeaders,
UPDATE_DOCUMENT_STATE_FREQUENCY_MILLISECONDS,
Expand Down Expand Up @@ -288,7 +289,13 @@ const ReviewDetailsDocumentUploadingStage = ({
<DocumentUploadingStage
documents={documents}
startUpload={startUpload}
documentConfig={getConfigForDocType(reviewData?.snomedCode!)}
title="Your documents are uploading"
warningBoxText={
'Do not close or navigate away from this page until the upload is complete.' +
(getConfigForDocType(reviewData?.snomedCode!).stitched
? ' Your files will be combined into one document when the upload is complete.'
: '')
}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const buildDoc = (fileName: string, state: DOCUMENT_UPLOAD_STATE): ReviewUploadD
file: new File([blob], fileName, { type: 'application/pdf' }),
id: `id-${fileName}`,
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 0,
blob,
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const makeReviewDoc = (
id: `id-${name}`,
file: new File(['%PDF-1.4'], name, { type: 'application/pdf' }),
docType: DOCUMENT_TYPE.LLOYD_GEORGE,
attempts: 0,
state,
type,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ describe('ReviewDetailsPatientSearchPage', () => {

await waitFor(() => {
expect(link).toBeInTheDocument();
expect(link).toHaveAttribute(
'href',
`/admin/reviews/${mockReviewId}/dont-know-nhs-number`,
);
});
});

Expand Down Expand Up @@ -230,7 +226,6 @@ describe('ReviewDetailsPatientSearchPage', () => {
await userEvent.click(continueButton);

await waitFor(() => {
expect(screen.getByText('There is a problem')).toBeInTheDocument();
const errorMessages = screen.getAllByText(incorrectFormatMessage);
expect(errorMessages.length).toBeGreaterThan(0);
});
Expand Down Expand Up @@ -785,7 +780,6 @@ describe('ReviewDetailsPatientSearchPage', () => {
blob: new Blob(['content'], { type: 'application/pdf' }),
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '1',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
] as ReviewUploadDocument[];
Expand Down Expand Up @@ -818,15 +812,13 @@ describe('ReviewDetailsPatientSearchPage', () => {
blob: mockBlob1,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '1',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
{
file: new File(['content2'], 'test2.pdf', { type: 'application/pdf' }),
blob: mockBlob2,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '2',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
] as ReviewUploadDocument[];
Expand Down Expand Up @@ -864,7 +856,6 @@ describe('ReviewDetailsPatientSearchPage', () => {
blob: mockBlob,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '1',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
] as ReviewUploadDocument[];
Expand Down Expand Up @@ -947,7 +938,6 @@ describe('ReviewDetailsPatientSearchPage', () => {
blob: new Blob(['content'], { type: 'application/pdf' }),
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '1',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
] as ReviewUploadDocument[];
Expand Down Expand Up @@ -989,21 +979,18 @@ describe('ReviewDetailsPatientSearchPage', () => {
file: mockPdfFile1,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '1',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
{
file: mockPdfFile2,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '2',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
{
file: mockNonPdfFile,
state: DOCUMENT_UPLOAD_STATE.SELECTED,
id: '3',
attempts: 0,
docType: '16521000000101' as DOCUMENT_TYPE,
},
] as ReviewUploadDocument[];
Expand Down
Loading