From 28dbbdc996abc46d118b2fce3c930c27bf651ff4 Mon Sep 17 00:00:00 2001 From: ameerul-deriv Date: Mon, 6 May 2024 17:15:46 +0800 Subject: [PATCH] fix: modalManager myProfileCounterparties test cases --- package.json | 2 +- src/hooks/__tests__/useModalManager.spec.tsx | 2 +- .../__tests__/MyProfileCounterparties.spec.tsx | 11 +++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 82796c7a..c0733bf0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "preview": "vite preview", "test:lint": "prettier --log-level silent --write . && eslint \"./src/**/*.?(js|jsx|ts|tsx)\"", "test": "jest --passWithNoTests", - "test:coverage": "jest --coverage --passWithNoTests --maxWorkers=75% --silent", + "test:coverage": "jest --coverage --passWithNoTests --runInBand", "prepare": "husky install" }, "dependencies": { diff --git a/src/hooks/__tests__/useModalManager.spec.tsx b/src/hooks/__tests__/useModalManager.spec.tsx index d9a04630..077eacae 100644 --- a/src/hooks/__tests__/useModalManager.spec.tsx +++ b/src/hooks/__tests__/useModalManager.spec.tsx @@ -17,7 +17,7 @@ jest.mock('react-router-dom', () => ({ })); const mockedUseQueryString = useQueryString as jest.MockedFunction; -jest.mock('@/hooks/useQueryString', () => ({ +jest.mock('@/hooks/custom-hooks/useQueryString', () => ({ __esModule: true, default: jest.fn(() => ({ deleteQueryString: jest.fn(), diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/__tests__/MyProfileCounterparties.spec.tsx b/src/pages/my-profile/screens/MyProfileCounterparties/__tests__/MyProfileCounterparties.spec.tsx index 4f7d8300..4e1c317b 100644 --- a/src/pages/my-profile/screens/MyProfileCounterparties/__tests__/MyProfileCounterparties.spec.tsx +++ b/src/pages/my-profile/screens/MyProfileCounterparties/__tests__/MyProfileCounterparties.spec.tsx @@ -14,16 +14,11 @@ jest.mock('@/components/Modals/RadioGroupFilterModal', () => ({ RadioGroupFilterModal: jest.fn(() =>
RadioGroupFilterModal
), })); -jest.mock('@/hooks/useDevice', () => ({ - __esModule: true, - default: jest.fn(() => ({ +jest.mock('@/hooks/custom-hooks', () => ({ + useDevice: jest.fn(() => ({ isMobile: false, })), -})); - -jest.mock('@/hooks/useQueryString', () => ({ - __esModule: true, - default: jest.fn(() => ({ + useQueryString: jest.fn(() => ({ setQueryString: jest.fn(), })), }));