Skip to content

Commit

Permalink
Fix tests broken by node v22 update
Browse files Browse the repository at this point in the history
  • Loading branch information
louise-davies committed Dec 11, 2024
1 parent 456b20e commit 5711efb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/api/functions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ describe('useValidateFunctions', () => {
await act(async () => {
await expect(
result.current.mutateAsync([functions[3]])
).rejects.toThrowError();
});

expect(result.current.error?.response?.data).toEqual({
detail:
"Error at index 0: 'centre' accepts {'waveform'} type(s), 'scalar' provided",
).rejects.toMatchObject({
response: {
data: {
detail:
"Error at index 0: 'centre' accepts {'waveform'} type(s), 'scalar' provided",
},
},
});
});
});

Expand Down
8 changes: 7 additions & 1 deletion src/views/dataView.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ describe('Data View', () => {
await flushPromises();
});

await screen.findByRole('progressbar');
await waitForElementToBeRemoved(() => screen.queryByRole('progressbar'));

const shotnumHeader = await screen.findByRole('columnheader', {
name: 'Shot Number',
});
Expand All @@ -99,7 +102,7 @@ describe('Data View', () => {
expect(dialogue).toBeVisible();
});

it('opens the functions dialogue when the functions button in a data header is clicked', async () => {
it('opens the functions dialogue when the functions button is clicked and closes when the close button is clicked', async () => {
const user = userEvent.setup();
const state = {
...getInitialState(),
Expand All @@ -121,6 +124,9 @@ describe('Data View', () => {
await flushPromises();
});

await screen.findByRole('progressbar');
await waitForElementToBeRemoved(() => screen.queryByRole('progressbar'));

const functionAHeader = await screen.findByRole('columnheader', {
name: 'a',
});
Expand Down

0 comments on commit 5711efb

Please sign in to comment.