From a2fdfc78d765ad02f3b6709f9da2dd98c7c9bec5 Mon Sep 17 00:00:00 2001 From: Karina Thomas Date: Mon, 25 Nov 2024 13:38:28 +0000 Subject: [PATCH 1/2] Fix no-import-assign error --- src/app/pages/MostReadPage/index.test.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/pages/MostReadPage/index.test.jsx b/src/app/pages/MostReadPage/index.test.jsx index e5321db3186..d6b6218d077 100644 --- a/src/app/pages/MostReadPage/index.test.jsx +++ b/src/app/pages/MostReadPage/index.test.jsx @@ -12,7 +12,12 @@ import MostReadPage from './MostReadPage'; fetch.mockResponse(JSON.stringify(pidginMostReadData)); -analyticsUtils.getAtUserId = jest.fn(); +jest.mock('#lib/analyticsUtils', () => { + return { + ...jest.requireActual('#lib/analyticsUtils'), + getAtUserId: jest.fn(), + }; +}); jest.mock('../../components/ChartbeatAnalytics', () => { const ChartbeatAnalytics = () =>
chartbeat
; From 2554656acafa9d5183ad50fad8cc120ac9671d8d Mon Sep 17 00:00:00 2001 From: Karina Thomas Date: Mon, 25 Nov 2024 14:12:28 +0000 Subject: [PATCH 2/2] Remove unused import --- src/app/pages/MostReadPage/index.test.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/pages/MostReadPage/index.test.jsx b/src/app/pages/MostReadPage/index.test.jsx index d6b6218d077..1062199ae2b 100644 --- a/src/app/pages/MostReadPage/index.test.jsx +++ b/src/app/pages/MostReadPage/index.test.jsx @@ -3,7 +3,6 @@ import { act } from '@testing-library/react'; import { BrowserRouter } from 'react-router-dom'; import { RequestContextProvider } from '#contexts/RequestContext'; import { data as pidginMostReadData } from '#data/pidgin/mostRead/index.json'; -import * as analyticsUtils from '#lib/analyticsUtils'; import { ToggleContextProvider } from '#contexts/ToggleContext'; import { MOST_READ_PAGE } from '#app/routes/utils/pageTypes'; import { render } from '../../components/react-testing-library-with-providers';