From 013b500d7942c179e779198f57a14bd1ec6101f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 8 Feb 2024 15:10:26 +0000 Subject: [PATCH] text: Fix tests --- .../src/@planx/components/FileUpload/Public.test.tsx | 6 +++++- editor.planx.uk/src/@planx/components/FileUpload/Public.tsx | 5 +---- .../src/@planx/components/FileUploadAndLabel/model.ts | 5 ----- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/FileUpload/Public.test.tsx b/editor.planx.uk/src/@planx/components/FileUpload/Public.test.tsx index 549881dcbc..021a580624 100644 --- a/editor.planx.uk/src/@planx/components/FileUpload/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/FileUpload/Public.test.tsx @@ -23,7 +23,11 @@ test("recovers previously submitted files when clicking the back button", async const uploadedFile = { data: { [dataField]: [dummyFile], - [PASSPORT_REQUESTED_FILES_KEY]: [dataField], + [PASSPORT_REQUESTED_FILES_KEY]: { + required: [dataField], + recommended: [], + optional: [], + }, }, }; diff --git a/editor.planx.uk/src/@planx/components/FileUpload/Public.tsx b/editor.planx.uk/src/@planx/components/FileUpload/Public.tsx index a8306014fb..aa2008a1f0 100644 --- a/editor.planx.uk/src/@planx/components/FileUpload/Public.tsx +++ b/editor.planx.uk/src/@planx/components/FileUpload/Public.tsx @@ -8,10 +8,7 @@ import { FileWithPath } from "react-dropzone"; import ErrorWrapper from "ui/shared/ErrorWrapper"; import { array } from "yup"; -import { - FileList, - PASSPORT_REQUESTED_FILES_KEY, -} from "../FileUploadAndLabel/model"; +import { PASSPORT_REQUESTED_FILES_KEY } from "../FileUploadAndLabel/model"; import { PrivateFileUpload } from "../shared/PrivateFileUpload/PrivateFileUpload"; import { getPreviouslySubmittedData, makeData } from "../shared/utils"; diff --git a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/model.ts b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/model.ts index fc5f823f40..4b4aea3c5c 100644 --- a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/model.ts +++ b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/model.ts @@ -227,11 +227,6 @@ const formatUserFiles = (userFile: UserFileWithSlots): FormattedUserFile[] => }, })); -const formatRequestedFiles = ({ - fn, - rule: { condition }, -}: FileType): RequestedFile => ({ fn, condition }); - /** * Type guard to coerce UserFile -> UserFileWithSlot */