diff --git a/package.json b/package.json index 9102384f..c0f2adc3 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@testing-library/dom": "10.4.0", "@testing-library/jest-dom": "6.4.6", "@testing-library/react": "16.0.0", - "@testing-library/user-event": "14.5.1", + "@testing-library/user-event": "14.5.2", "@typescript-eslint/eslint-plugin": "7.17.0", "@typescript-eslint/parser": "7.17.0", "@typescript-eslint/typescript-estree": "7.17.0", diff --git a/src/operationsgateway-logo-white.svg b/public/operationsgateway-logo-white.svg similarity index 100% rename from src/operationsgateway-logo-white.svg rename to public/operationsgateway-logo-white.svg diff --git a/src/operationsgateway-logo.svg b/public/operationsgateway-logo.svg similarity index 100% rename from src/operationsgateway-logo.svg rename to public/operationsgateway-logo.svg diff --git a/src/api/records.tsx b/src/api/records.tsx index 0f833fba..23cc8123 100644 --- a/src/api/records.tsx +++ b/src/api/records.tsx @@ -230,6 +230,7 @@ export const fetchRangeRecordConverterQuery = ( if (shotnumMin || shotnumMax) { inputRange = { min: shotnumMin, max: shotnumMax }; } + console.log('RETURNING RESULT'); return { ...inputRange, ...response.data }; } }); diff --git a/src/main.test.tsx b/src/main.test.tsx index edcb3207..26cb92c2 100644 --- a/src/main.test.tsx +++ b/src/main.test.tsx @@ -35,7 +35,7 @@ describe('index - fetchSettings', () => { displayName: 'displayName', }, ], - pluginHost: 'http://localhost:3000/', + pluginHost: 'http://localhost:3000', }; server.use( diff --git a/src/main.tsx b/src/main.tsx index 35416e8a..d8c39d9f 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -10,10 +10,10 @@ import ReactDOMClient from 'react-dom/client'; import singleSpaReact from 'single-spa-react'; import App from './App'; import { MicroFrontendId, MicroFrontendToken } from './app.types'; -import LogoDark from './operationsgateway-logo-white.svg'; -import LogoLight from './operationsgateway-logo.svg'; import { OperationsGatewaySettings, setSettings } from './settings'; import { PluginRoute, registerRoute } from './state/scigateway.actions'; +import LogoDark from '/operationsgateway-logo-white.svg'; +import LogoLight from '/operationsgateway-logo.svg'; export const pluginName = 'operationsgateway'; diff --git a/src/search/searchBar.component.test.tsx b/src/search/searchBar.component.test.tsx index dc019279..8a500585 100644 --- a/src/search/searchBar.component.test.tsx +++ b/src/search/searchBar.component.test.tsx @@ -760,12 +760,17 @@ describe('searchBar component', () => { await user.click(screen.getByLabelText('open shot number search box')); const shotnumPopup = screen.getByRole('dialog'); + + // Wait for the shot number to be updated after the timeframe + expect( + await within(shotnumPopup).findByDisplayValue('5') + ).toBeInTheDocument(); + const shotnumMax = within(shotnumPopup).getByRole('spinbutton', { name: 'Max', }); await user.clear(shotnumMax); - await user.type(shotnumMax, '16'); await user.click(screen.getByLabelText('close shot number search box')); diff --git a/src/setupTests.ts b/src/setupTests.ts index fc8275f4..2f56dae5 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -3,10 +3,13 @@ // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; +import { TextEncoder } from 'util'; import 'vitest-canvas-mock'; import failOnConsole from 'vitest-fail-on-console'; import { server } from './mocks/server'; +global.TextEncoder = TextEncoder; + failOnConsole(); vi.setConfig({ testTimeout: 15000 }); diff --git a/src/windows/openWindows.component.test.tsx b/src/windows/openWindows.component.test.tsx index 664d8f2d..d601a553 100644 --- a/src/windows/openWindows.component.test.tsx +++ b/src/windows/openWindows.component.test.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { DEFAULT_WINDOW_VARS } from '../app.types'; import { RootState } from '../state/store'; import { @@ -6,6 +7,7 @@ import { testPlotConfigs, } from '../testUtils'; import OpenWindows from './openWindows.component'; +import { WindowsRefType } from './windowContext'; // need to mock to avoid errors vi.mock('../plotting/plotWindow.component', () => { diff --git a/src/windows/openWindows.component.tsx b/src/windows/openWindows.component.tsx index 5698c2c3..67b032f9 100644 --- a/src/windows/openWindows.component.tsx +++ b/src/windows/openWindows.component.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import ImageWindow from '../images/imageWindow.component'; import PlotWindow from '../plotting/plotWindow.component'; import { useAppDispatch, useAppSelector } from '../state/hooks'; diff --git a/yarn.lock b/yarn.lock index 073e5885..c7745b82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3329,12 +3329,12 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:14.5.1": - version: 14.5.1 - resolution: "@testing-library/user-event@npm:14.5.1" +"@testing-library/user-event@npm:14.5.2": + version: 14.5.2 + resolution: "@testing-library/user-event@npm:14.5.2" peerDependencies: "@testing-library/dom": ">=7.21.4" - checksum: 10c0/1e00d6ead23377885b906db6e46e259161a0efb4138f7527481d7435f3c8f65cb7e3eab2900e2ac1886fa6dd03416e773a3a60dea87a9a2086a7127dee315f6f + checksum: 10c0/68a0c2aa28a3c8e6eb05cafee29705438d7d8a9427423ce5064d44f19c29e89b5636de46dd2f28620fb10abba75c67130185bbc3aa23ac1163a227a5f36641e1 languageName: node linkType: hard @@ -8713,7 +8713,7 @@ __metadata: "@testing-library/dom": "npm:10.4.0" "@testing-library/jest-dom": "npm:6.4.6" "@testing-library/react": "npm:16.0.0" - "@testing-library/user-event": "npm:14.5.1" + "@testing-library/user-event": "npm:14.5.2" "@types/node": "npm:20.14.10" "@types/react": "npm:18.3.3" "@types/react-dom": "npm:18.3.0"