[FIX] Storybook race condition (#9936)

Flaky test can be found
[here](https://github.com/twentyhq/twenty/actions/runs/13052735697/job/36416799488)
Action should be outside the waitFor callback

## Context
It seems to occurs since the Charles tooltip perf refactor
ae4bf8d929
Maybe the tests render being faster it changed order of execution ? idk
still interesting
This commit is contained in:
Paul Rastoin
2025-01-30 16:57:53 +01:00
committed by GitHub
parent 4084f2114e
commit 385bf591cf

View File

@ -139,10 +139,8 @@ export const Submit: Story = {
timeout: 3000,
});
await waitFor(() => {
userEvent.click(item);
expect(submitJestFn).toHaveBeenCalledTimes(1);
});
await userEvent.click(item);
await waitFor(() => expect(submitJestFn).toHaveBeenCalledTimes(1));
},
};