From 83fcb4e1dd61b28f94b025e706db631ecf98401b Mon Sep 17 00:00:00 2001 From: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:38:35 +0100 Subject: [PATCH 1/2] test(TableWrapper): remove mocking immutability-helper dep Signed-off-by: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com> --- ui/jest.polyfills.ts | 4 ++++ ui/src/components/table/tests/TableWrapper.test.tsx | 2 -- 2 files changed, 4 insertions(+), 2 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/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(); From 23e3c9aa883297dc5800e1c865c299dc2a81b0ef Mon Sep 17 00:00:00 2001 From: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com> Date: Mon, 25 Nov 2024 10:47:17 +0100 Subject: [PATCH 2/2] one more Signed-off-by: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com> --- ui/src/components/DeleteModal/DeleteModal.test.tsx | 1 - 1 file changed, 1 deletion(-) 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();