From 9cd4a754758e484dc37fe225f1cdc8b78dd6f116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Fri, 9 Feb 2024 12:05:10 +0000 Subject: [PATCH] fix: Silly typo! --- .../@planx/components/DrawBoundary/Public/Public.test.tsx | 6 ++---- editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx index abae3f1d6e..6bb2c55aba 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx @@ -2,7 +2,7 @@ import { Breadcrumbs } from "@opensystemslab/planx-core/types"; import { PASSPORT_REQUESTED_FILES_KEY } from "@planx/components/FileUploadAndLabel/model"; import { screen } from "@testing-library/react"; import axios from "axios"; -import { useStore, vanillaStore } from "pages/FlowEditor/lib/store"; +import { vanillaStore } from "pages/FlowEditor/lib/store"; import React from "react"; import { act } from "react-dom/test-utils"; import { axe, setup } from "testUtils"; @@ -341,9 +341,7 @@ test("appends to existing '_requestedFiles' value", async () => { ); // Check current passport setup - const passport = getState().computePassport(); - const existingRequestedFiles = passport.data?.[PASSPORT_REQUESTED_FILES_KEY]; - expect(existingRequestedFiles).toBeDefined(); + const existingRequestedFiles = getState().requestedFiles(); expect(existingRequestedFiles).toMatchObject({ required: ["floorPlan", "utilityBill"], recommended: ["elevations.existing"], 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 ecf33cf7df..96deef9086 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts @@ -641,8 +641,7 @@ 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 PASSPORT_REQUESTED_FILES_KEY = "_requestedFiles"; const { computePassport } = get(); const currentRequestedFiles = computePassport().data?.[PASSPORT_REQUESTED_FILES_KEY];