Remove user action from waitFor in stories (#11588)
As per title: - waitFor is a loop that waits for a condition to be filled, it should be use to expect or in rare case to wait for element to be present in the page (in most cases, you can use findByXXX) - user actions should not be in this loop, otherwise they will be triggered multiple times
This commit is contained in:
@ -5,8 +5,8 @@ import { expect, userEvent, within } from '@storybook/test';
|
||||
import { IconsProviderDecorator } from '~/testing/decorators/IconsProviderDecorator';
|
||||
import { sleep } from '~/utils/sleep';
|
||||
|
||||
import { IconPicker, IconPickerProps } from '../IconPicker';
|
||||
import { ComponentDecorator } from 'twenty-ui/testing';
|
||||
import { IconPicker, IconPickerProps } from '../IconPicker';
|
||||
|
||||
type RenderProps = IconPickerProps;
|
||||
const Render = (args: RenderProps) => {
|
||||
@ -123,7 +123,7 @@ export const WithSearchAndClose: Story = {
|
||||
name: 'Click to select icon (selected: IconBuildingSkyscraper)',
|
||||
});
|
||||
|
||||
userEvent.click(iconPickerButton);
|
||||
await userEvent.click(iconPickerButton);
|
||||
|
||||
await sleep(500);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user