From 69f7a5a446d1e037ffc13f172a06c5bfc6929951 Mon Sep 17 00:00:00 2001 From: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:20:27 +0100 Subject: [PATCH] test(TableWrapper): remove mocking immutability-helper dep (#1471) --- ui/jest.polyfills.ts | 4 ++++ ui/src/components/DeleteModal/DeleteModal.test.tsx | 1 - ui/src/components/table/tests/TableWrapper.test.tsx | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/jest.polyfills.ts b/ui/jest.polyfills.ts index 94ad52b31..597b8c0eb 100644 --- a/ui/jest.polyfills.ts +++ b/ui/jest.polyfills.ts @@ -9,15 +9,19 @@ * you don't want to deal with this. */ +const { performance } = require('node:perf_hooks'); const { TextDecoder, TextEncoder } = require('node:util'); const { TransformStream } = require('node:stream/web'); const { BroadcastChannel } = require('node:worker_threads'); +const { clearImmediate } = require('node:timers'); Object.defineProperties(globalThis, { TextDecoder: { value: TextDecoder }, TextEncoder: { value: TextEncoder }, TransformStream: { value: TransformStream }, BroadcastChannel: { value: BroadcastChannel }, + clearImmediate: { value: clearImmediate }, + performance: { value: performance }, }); const { Blob } = require('node:buffer'); diff --git a/ui/src/components/DeleteModal/DeleteModal.test.tsx b/ui/src/components/DeleteModal/DeleteModal.test.tsx index 37de666b3..dbd8dbc4d 100644 --- a/ui/src/components/DeleteModal/DeleteModal.test.tsx +++ b/ui/src/components/DeleteModal/DeleteModal.test.tsx @@ -5,7 +5,6 @@ import { http, HttpResponse } from 'msw'; import DeleteModal from './DeleteModal'; import { server } from '../../mocks/server'; -jest.mock('immutability-helper'); jest.mock('../../util/util'); const handleClose = jest.fn(); diff --git a/ui/src/components/table/tests/TableWrapper.test.tsx b/ui/src/components/table/tests/TableWrapper.test.tsx index f625a438c..f420e6271 100644 --- a/ui/src/components/table/tests/TableWrapper.test.tsx +++ b/ui/src/components/table/tests/TableWrapper.test.tsx @@ -14,8 +14,6 @@ import { SIMPLE_NAME_TABLE_MOCK_DATA, } from '../stories/configMockups'; -jest.mock('immutability-helper'); - const handleRequestModalOpen = jest.fn(); const handleOpenPageStyleDialog = jest.fn();