diff --git a/awx/ui/src/App.test.js b/awx/ui/src/App.test.js index bdc71de49f..e1f2fb3bc3 100644 --- a/awx/ui/src/App.test.js +++ b/awx/ui/src/App.test.js @@ -7,7 +7,7 @@ import { mountWithContexts } from '../testUtils/enzymeHelpers'; import App, { ProtectedRoute } from './App'; jest.mock('./api'); -jest.mock('screens/TopologyView/utils/WebWorker', () => jest.fn()); +jest.mock('util/webWorker', () => jest.fn()); describe('', () => { beforeEach(() => { diff --git a/awx/ui/src/index.test.js b/awx/ui/src/index.test.js index ffde7d7d9c..a0419c9933 100644 --- a/awx/ui/src/index.test.js +++ b/awx/ui/src/index.test.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import App from './App'; jest.mock('react-dom', () => ({ render: jest.fn() })); -jest.mock('screens/TopologyView/utils/WebWorker', () => jest.fn()); +jest.mock('util/webWorker', () => jest.fn()); describe('index.jsx', () => { it('renders ok', () => { diff --git a/awx/ui/src/routeConfig.test.js b/awx/ui/src/routeConfig.test.js index 643bd13dfd..5a7def4348 100644 --- a/awx/ui/src/routeConfig.test.js +++ b/awx/ui/src/routeConfig.test.js @@ -1,5 +1,5 @@ import getRouteConfig from './routeConfig'; -jest.mock('screens/TopologyView/utils/WebWorker', () => jest.fn()); +jest.mock('util/webWorker', () => jest.fn()); const userProfile = { isSuperUser: false, diff --git a/awx/ui/src/screens/TopologyView/MeshGraph.js b/awx/ui/src/screens/TopologyView/MeshGraph.js index d643044e68..2d7700b45e 100644 --- a/awx/ui/src/screens/TopologyView/MeshGraph.js +++ b/awx/ui/src/screens/TopologyView/MeshGraph.js @@ -17,7 +17,7 @@ import { // generateRandomNodes, // getRandomInt, } from './utils/helpers'; -import webWorker from './utils/webWorker'; +import webWorker from '../../util/webWorker'; import { DEFAULT_RADIUS, DEFAULT_NODE_COLOR, diff --git a/awx/ui/src/screens/TopologyView/utils/webWorker.js b/awx/ui/src/screens/TopologyView/utils/webWorker.js deleted file mode 100644 index 7cc564b1c5..0000000000 --- a/awx/ui/src/screens/TopologyView/utils/webWorker.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function webWorker() { - return new Worker(new URL('./workers/simulationWorker.js', import.meta.url)); -} diff --git a/awx/ui/src/util/webWorker.js b/awx/ui/src/util/webWorker.js new file mode 100644 index 0000000000..64c2eac037 --- /dev/null +++ b/awx/ui/src/util/webWorker.js @@ -0,0 +1,8 @@ +export default function webWorker() { + return new Worker( + new URL( + 'screens/TopologyView/utils/workers/simulationWorker.js', + import.meta.url + ) + ); +}