Skip to content

Commit

Permalink
Merge pull request #12207 from bbc/NEWSWORLDSERVICE-1477-no-import-as…
Browse files Browse the repository at this point in the history
…sign

NEWSWORLDSERVICE-1477: Fix no-import-assign error
  • Loading branch information
karinathomasbbc authored Nov 25, 2024
2 parents c4c8e6d + 60436da commit 032cbc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/pages/MostReadPage/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -12,7 +11,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 = () => <div>chartbeat</div>;
Expand Down

0 comments on commit 032cbc3

Please sign in to comment.