Skip to content

Commit

Permalink
fix: Silly typo!
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Feb 9, 2024
1 parent 22db80b commit 9cd4a75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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"],
Expand Down
3 changes: 1 addition & 2 deletions editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 9cd4a75

Please sign in to comment.