diff --git a/src/components/bookmarks-panel/bookmarks-panel.spec.tsx b/src/components/bookmarks-panel/bookmarks-panel.spec.tsx index 08cdf267..a1364469 100644 --- a/src/components/bookmarks-panel/bookmarks-panel.spec.tsx +++ b/src/components/bookmarks-panel/bookmarks-panel.spec.tsx @@ -11,6 +11,12 @@ jest.mock("../../utils/hooks/layout"); const dragAndDropText = "Drag and drop your json file here"; +Object.defineProperty(globalThis, "crypto", { + value: { + randomUUID: () => "", + }, +}); + const TEST_BOOKMARKS = [ { id: "testId1", diff --git a/src/components/comparison/comparison-side/comparison-side.tsx b/src/components/comparison/comparison-side/comparison-side.tsx index b0b404c3..b009dcf2 100644 --- a/src/components/comparison/comparison-side/comparison-side.tsx +++ b/src/components/comparison/comparison-side/comparison-side.tsx @@ -320,6 +320,7 @@ export const ComparisonSide = ({ .map((sublayer) => ({ id: sublayer.id, url: sublayer.url, + fetch: sublayer.fetch, token: sublayer.token, type: sublayer.type ?? TilesetType.I3S, })); diff --git a/src/components/layers-panel/insert-panel/insert-panel.spec.tsx b/src/components/layers-panel/insert-panel/insert-panel.spec.tsx index fd20dc26..0b9e6849 100644 --- a/src/components/layers-panel/insert-panel/insert-panel.spec.tsx +++ b/src/components/layers-panel/insert-panel/insert-panel.spec.tsx @@ -10,6 +10,12 @@ import "@testing-library/jest-dom"; const onInsertMock = jest.fn(); const onCancelMock = jest.fn(); +Object.defineProperty(globalThis, "crypto", { + value: { + randomUUID: () => "", + }, +}); + const callRender = ( renderFunc, props = {}, diff --git a/src/components/upload-panel/upload-panel.spec.tsx b/src/components/upload-panel/upload-panel.spec.tsx index 0a988cc7..0d1c6d30 100644 --- a/src/components/upload-panel/upload-panel.spec.tsx +++ b/src/components/upload-panel/upload-panel.spec.tsx @@ -15,6 +15,12 @@ jest.mock("@hyperjump/json-schema", () => ({ ), })); +Object.defineProperty(globalThis, "crypto", { + value: { + randomUUID: () => "", + }, +}); + const onCancel = jest.fn(); const onFileUploaded = jest.fn(); diff --git a/src/components/upload-panel/upload-panel.tsx b/src/components/upload-panel/upload-panel.tsx index 051c8df8..388a5caf 100644 --- a/src/components/upload-panel/upload-panel.tsx +++ b/src/components/upload-panel/upload-panel.tsx @@ -5,11 +5,9 @@ import { UploadPanelItem } from "./upload-panel-item"; import UploadIcon from "../../../public/icons/upload.svg"; import { Layout } from "../../utils/enums"; -import { useRef, useState } from "react"; +import { useMemo, useRef, useState } from "react"; import { useAppLayout } from "../../utils/hooks/layout"; -const UPLOAD_INPUT_ID = "upload-file-input"; - const FileInteractionContainer = styled.label` box-sizing: border-box; display: flex; @@ -83,6 +81,8 @@ export const UploadPanel = ({ onFileUploaded, onFileEvent, }: UploadProps) => { + const UPLOAD_INPUT_ID = useMemo(() => `upload-file-input${crypto.randomUUID()}`, []); + const layout = useAppLayout(); const [dragActive, setDragActive] = useState(false); const [fileUploaded, setFileUploaded] = useState(""); diff --git a/src/pages/debug-app/debug-app.tsx b/src/pages/debug-app/debug-app.tsx index 1db04e7f..062d4a8a 100644 --- a/src/pages/debug-app/debug-app.tsx +++ b/src/pages/debug-app/debug-app.tsx @@ -192,6 +192,7 @@ export const DebugApp = () => { .map((sublayer) => ({ id: sublayer.id, url: sublayer.url, + fetch: sublayer.fetch, token: sublayer.token, type: sublayer.type ?? TilesetType.I3S, }));