Skip to content

Commit 0903fe1

Browse files
committed
test: fix flaky combobox test
Refs: LINK-2581
1 parent 69074b2 commit 0903fe1

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/domain/event/formSections/classificationSection/__tests__/ClassificationSection.test.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,18 @@ test('should change keyword', async () => {
263263
await user.click(keywordOption);
264264
await user.keyboard('{Escape}');
265265

266-
await screen.findByRole('button', {
267-
name: new RegExp(
268-
`1 valittu vaihtoehto.*${getValue(keyword?.name?.fi, '')}`,
269-
'i'
270-
),
271-
});
266+
await waitFor(
267+
() =>
268+
expect(
269+
screen.getByRole('button', {
270+
name: new RegExp(
271+
`1 valittu vaihtoehto.*${getValue(keyword?.name?.fi, '')}`,
272+
'i'
273+
),
274+
})
275+
).toBeInTheDocument(),
276+
{ timeout: 5000 }
277+
);
272278
});
273279

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

0 commit comments

Comments
 (0)