You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @storybook/test-runner to run interaction test for simple form managed by react-hook-form, tests will randomly fail a few times in a hundred runs. At first I thought it is caused by #18258, however, after upgrading everything the issue persisted.
After a lot of trial and error, I managed to get to a consistent reproduction which can be achieved by configuring test runner to run in headed mode with devtools enabled. In that configuration, simple test will always fail. Text gets entered in the input field but empty string gets submitted.
I'm not entirely sure the issue is in storybook. I'm assuming it is because I cannot reproduce it if I test the same storybook page using playwright directly. Or, if I run vite dev server and point playwright tests to it.
To reproduce, first install dependencies then start storybook dev server. Open http://localhost:6009/?path=/story/nativerhfinteraction--text-input, it will most likely work when run in storybook directly. Now run test-storybook. It will open Chromium browser with devtools enabled and you'll see toast notification in the bottom left corner which will have empty text.
Next, try running test script. It will also open Chromium with devtools enabled, but this time the test will pass because notification will have the correct text.
Describe the bug
When using
@storybook/test-runner
to run interaction test for simple form managed byreact-hook-form
, tests will randomly fail a few times in a hundred runs. At first I thought it is caused by #18258, however, after upgrading everything the issue persisted.After a lot of trial and error, I managed to get to a consistent reproduction which can be achieved by configuring test runner to run in headed mode with devtools enabled. In that configuration, simple test will always fail. Text gets entered in the input field but empty string gets submitted.
I'm not entirely sure the issue is in storybook. I'm assuming it is because I cannot reproduce it if I test the same storybook page using playwright directly. Or, if I run vite dev server and point playwright tests to it.
To Reproduce
Repository of the reproduction can be found here.
To reproduce, first install dependencies then start storybook dev server. Open
http://localhost:6009/?path=/story/nativerhfinteraction--text-input
, it will most likely work when run in storybook directly. Now runtest-storybook
. It will open Chromium browser with devtools enabled and you'll see toast notification in the bottom left corner which will have empty text.Next, try running
test
script. It will also open Chromium with devtools enabled, but this time the test will pass because notification will have the correct text.System
Additional context
No response
The text was updated successfully, but these errors were encountered: