Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Formik } from 'formik';
import getValue from '../../../../../utils/getValue';
import { mockAuthenticatedLoginState } from '../../../../../utils/mockLoginHooks';
import {
cleanup,
configure,
render,
screen,
Expand Down Expand Up @@ -46,6 +47,7 @@ import ClassificationSection from '../ClassificationSection';
configure({ defaultHidden: true });

afterEach(() => {
cleanup();
vi.resetAllMocks();
});

Expand Down Expand Up @@ -263,12 +265,16 @@ test('should change keyword', async () => {
await user.click(keywordOption);
await user.keyboard('{Escape}');

await screen.findByRole('button', {
name: new RegExp(
`1 valittu vaihtoehto.*${getValue(keyword?.name?.fi, '')}`,
'i'
),
});
await screen.findByRole(
'button',
{
name: new RegExp(
`1 valittu vaihtoehto.*${getValue(keyword?.name?.fi, '')}`,
'i'
),
},
{ timeout: 5000 }
);
});

test('should show correct validation error if none main category is selected', async () => {
Expand Down