From 22db80bf1cf96c7c58fa1cbcde842f6a93ddbb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 9 Feb 2024 11:36:29 +0000 Subject: [PATCH] docs: Explain hardcoded const --- editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts index 224cd05337..ecf33cf7df 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts @@ -639,8 +639,13 @@ export const previewStore: StateCreator< }, requestedFiles: () => { + // Importing PASSPORT_REQUESTED_FILES_KEY causes tests to fail - possible circular dependency issue? + // Repeating it here so find and replace still points to this hardcoded value + const PASSPORT_REQUESTED_FILES_KEY = "_requiredFiles"; + const { computePassport } = get(); - const currentRequestedFiles = computePassport().data?._requestedFiles; + const currentRequestedFiles = + computePassport().data?.[PASSPORT_REQUESTED_FILES_KEY]; const emptyFileList = { required: [], recommended: [], optional: [] }; return currentRequestedFiles || emptyFileList;