Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactions: assertion in waitFor causes UI to flicker #16492

Closed
ghengeveld opened this issue Oct 27, 2021 · 1 comment
Closed

Interactions: assertion in waitFor causes UI to flicker #16492

ghengeveld opened this issue Oct 27, 2021 · 1 comment

Comments

@ghengeveld
Copy link
Member

ghengeveld commented Oct 27, 2021

Describe the bug

Given this play function:

await userEvent.click(await within(canvasElement).findByText('Click'));
await waitFor(async () => {
    await expect(args.onSubmit).toHaveBeenCalledWith(expect.stringMatching(/([A-Z])\w+/gi));
});

The expect might fail initially, and then succeed on the 2nd try of waitFor. This causes the status badge in the UI to go red for a brief moment before turning green, and the log will show the error for a moment.

We should show the "pending" state when an assertion fails inside a waitFor, until it times out.

To Reproduce

See Interactions on https://5a375b97f4b14f0020b0cda3-buizxbusoa.chromatic.com/?path=/story/addons-interactions-accountform--wait-for

┆Issue is synchronized with this Asana task by Unito

@shilman
Copy link
Member

shilman commented Jun 21, 2022

Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.6 containing PR #18518 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants