Skip to content

Commit

Permalink
DSEGOG-341 Fix logo and tests after merge, update user-event
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Aug 16, 2024
1 parent feeadc3 commit 683e819
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions src/api/records.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export const fetchRangeRecordConverterQuery = (
if (shotnumMin || shotnumMax) {
inputRange = { min: shotnumMin, max: shotnumMax };
}
console.log('RETURNING RESULT');
return { ...inputRange, ...response.data };
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('index - fetchSettings', () => {
displayName: 'displayName',
},
],
pluginHost: 'http://localhost:3000/',
pluginHost: 'http://localhost:3000',
};

server.use(
Expand Down
4 changes: 2 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
7 changes: 6 additions & 1 deletion src/search/searchBar.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
3 changes: 3 additions & 0 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
2 changes: 2 additions & 0 deletions src/windows/openWindows.component.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { DEFAULT_WINDOW_VARS } from '../app.types';
import { RootState } from '../state/store';
import {
Expand All @@ -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', () => {
Expand Down
1 change: 1 addition & 0 deletions src/windows/openWindows.component.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 683e819

Please sign in to comment.