From 63c8af8226604c8fd3e1eb28c80bfeca98b9009a Mon Sep 17 00:00:00 2001 From: Joe Fong Date: Fri, 17 May 2024 17:29:51 +0100 Subject: [PATCH] [PRMDR-873] address sonarcloud issue --- .../components/blocks/_arf/selectStage/SelectStage.test.tsx | 2 -- app/src/components/blocks/_arf/selectStage/SelectStage.tsx | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/components/blocks/_arf/selectStage/SelectStage.test.tsx b/app/src/components/blocks/_arf/selectStage/SelectStage.test.tsx index fb3ac254e..b31630899 100644 --- a/app/src/components/blocks/_arf/selectStage/SelectStage.test.tsx +++ b/app/src/components/blocks/_arf/selectStage/SelectStage.test.tsx @@ -20,8 +20,6 @@ import { PatientDetails } from '../../../../types/generic/patientDetails'; import usePatient from '../../../../helpers/hooks/usePatient'; import uploadDocuments, { uploadDocumentToS3 } from '../../../../helpers/requests/uploadDocuments'; import { useState } from 'react'; -import { createMemoryHistory } from 'history'; -import { SUBMISSION_STATE } from '../../../../types/pages/documentSearchResultsPage/types'; import { routes } from '../../../../types/generic/routes'; const mockedUseNavigate = jest.fn(); diff --git a/app/src/components/blocks/_arf/selectStage/SelectStage.tsx b/app/src/components/blocks/_arf/selectStage/SelectStage.tsx index 7479f280c..e13641b01 100644 --- a/app/src/components/blocks/_arf/selectStage/SelectStage.tsx +++ b/app/src/components/blocks/_arf/selectStage/SelectStage.tsx @@ -39,7 +39,7 @@ function SelectStage({ setDocuments, setStage, documents }: Props) { const baseHeaders = useBaseAPIHeaders(); const navigate = useNavigate(); const arfInputRef = useRef(null); - // const lgInputRef = useRef(null); // NO SONAR + // const lgInputRef = useRef(null); // NOSONAR const patientDetails = usePatient(); const nhsNumber: string = patientDetails?.nhsNumber ?? ''; const mergedDocuments = [...arfDocuments, ...lgDocuments]; @@ -47,7 +47,7 @@ function SelectStage({ setDocuments, setStage, documents }: Props) { const { handleSubmit, control, formState, setError } = useForm(); - // const lgController = useController(lloydGeorgeFormConfig(control)); // NO SONAR + // const lgController = useController(lloydGeorgeFormConfig(control)); // NOSONAR const arfController = useController(ARFFormConfig(control)); const submitDocuments = async () => { @@ -103,12 +103,14 @@ function SelectStage({ setDocuments, setStage, documents }: Props) { if (error.response?.status === 403) { navigate(routes.SESSION_EXPIRED); } else if (isMock(error)) { + /* istanbul ignore next */ setDocuments((prevState) => prevState.map((doc) => ({ ...doc, state: DOCUMENT_UPLOAD_STATE.SUCCEEDED, })), ); + /* istanbul ignore next */ setStage(UPLOAD_STAGE.Complete); } else { navigate(routes.SERVER_ERROR + errorToParams(error));