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/bookmarks-panel/bookmarks-panel.tsx b/src/components/bookmarks-panel/bookmarks-panel.tsx index 6246e962..0902b142 100644 --- a/src/components/bookmarks-panel/bookmarks-panel.tsx +++ b/src/components/bookmarks-panel/bookmarks-panel.tsx @@ -42,12 +42,6 @@ enum PopoverType { none, } -Object.defineProperty(globalThis, "crypto", { - value: { - randomUUID: () => "", - }, -}); - const Container = styled.div` position: absolute; background: ${({ theme }) => theme.colors.mainCanvasColor}; 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..e3118264 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,13 @@ 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/layers-panel/insert-panel/insert-panel.tsx b/src/components/layers-panel/insert-panel/insert-panel.tsx index fffeb647..b05da128 100644 --- a/src/components/layers-panel/insert-panel/insert-panel.tsx +++ b/src/components/layers-panel/insert-panel/insert-panel.tsx @@ -27,12 +27,6 @@ import { import { UploadPanel } from "../../upload-panel/upload-panel"; import { getLayerUrl } from "../../../utils/layer-utils"; -Object.defineProperty(globalThis, "crypto", { - value: { - randomUUID: () => "", - }, -}); - const NO_NAME_ERROR = "Please enter name"; const INVALID_URL_ERROR = "Invalid URL";