From 0be6b3c2ddaf51eddfe3b381417039fbd45e8093 Mon Sep 17 00:00:00 2001 From: Rukh-Khan Date: Fri, 10 Jan 2025 19:38:15 +0530 Subject: [PATCH] #2970: autoGen-talawa-admin-docs-debugging --- package-lock.json | 16 ------------- package.json | 2 -- .../OrganizationVenues.spec.tsx | 24 +++++++++++++++---- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 759f846c51..83e2514d22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,7 +86,6 @@ "@types/inquirer": "^9.0.7", "@types/jest": "^26.0.24", "@types/js-cookie": "^3.0.6", - "@types/node": "^22.10.5", "@types/node-fetch": "^2.6.10", "@types/react": "^18.3.12", "@types/react-beautiful-dnd": "^13.1.8", @@ -119,7 +118,6 @@ "postcss-modules": "^6.0.1", "sass": "^1.80.7", "tsx": "^4.19.1", - "typescript": "^5.7.3", "vite-plugin-svgr": "^4.2.0", "vitest": "^2.1.5", "whatwg-fetch": "^3.6.20" @@ -19248,20 +19246,6 @@ "node": ">= 14" } }, - "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", diff --git a/package.json b/package.json index 13a733803b..51ddaab189 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,6 @@ "@types/inquirer": "^9.0.7", "@types/jest": "^26.0.24", "@types/js-cookie": "^3.0.6", - "@types/node": "^22.10.5", "@types/node-fetch": "^2.6.10", "@types/react": "^18.3.12", "@types/react-beautiful-dnd": "^13.1.8", @@ -156,7 +155,6 @@ "postcss-modules": "^6.0.1", "sass": "^1.80.7", "tsx": "^4.19.1", - "typescript": "^5.7.3", "vite-plugin-svgr": "^4.2.0", "vitest": "^2.1.5", "whatwg-fetch": "^3.6.20" diff --git a/src/screens/OrganizationVenues/OrganizationVenues.spec.tsx b/src/screens/OrganizationVenues/OrganizationVenues.spec.tsx index 1f4faddafd..0c271033c7 100644 --- a/src/screens/OrganizationVenues/OrganizationVenues.spec.tsx +++ b/src/screens/OrganizationVenues/OrganizationVenues.spec.tsx @@ -34,11 +34,25 @@ import { vi } from 'vitest'; import { errorHandler } from 'utils/errorHandler'; // Mock MutationObserver -global.MutationObserver = class { - constructor(callback: Function) {} - disconnect() {} - observe(element: any, initObject: any) {} -}; +import type { + MutationCallback, + MutationObserver, + MutationRecord, +} from '@types/node'; + +if (typeof global.MutationObserver !== 'function') { + global.MutationObserver = class MutationObserver { + constructor(callback: MutationCallback) { + this.callback = callback; + } + observe(target: Node, options?: MutationObserverInit) {} + disconnect() {} + takeRecords(): MutationRecord[] { + return []; + } + private callback: MutationCallback; + }; +} const MOCKS = [ {