Skip to content

Commit

Permalink
💚 [#4267] Handle async behaviour in interaction test
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Jun 20, 2024
1 parent c540a7b commit ee57bb7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useArgs} from '@storybook/preview-api';
import {expect, fn, userEvent, within} from '@storybook/test';
import {expect, fn, userEvent, waitFor, within} from '@storybook/test';

import {FormDecorator} from 'components/admin/form_design/story-decorators';
import Field from 'components/admin/forms/Field';
Expand Down Expand Up @@ -198,7 +198,9 @@ export const AutoSelectApiGroup = {
const v2Tab = canvas.getByRole('tab', {selected: false});
await userEvent.click(v2Tab);

expect(canvas.getByLabelText('Objects API group')).toHaveValue('1');
await waitFor(() => {
expect(canvas.getByLabelText('Objects API group')).toHaveValue('1');
});
},
};

Expand Down

0 comments on commit ee57bb7

Please sign in to comment.