[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
https://github.com/twentyhq/twenty/commit/ae4bf8d9298ca77cc45f6f4b0c25b66b51ad834f
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
@@ -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));
},
};