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;