-
Notifications
You must be signed in to change notification settings - Fork 7
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
Most of the story tests failing when used with storybook/[email protected] #103
Comments
Thanks for reporting @certainlyakey! Just some notes: For example: https://storybook.js.org/docs/writing-tests/test-runner#helpers
vs
In the second example, we are much more likely to experience the This is not meant as a solution, just hopefully sheds some light on the issue. |
Thanks for reporting! I haven't tried using React 19 or storybook 8.5 in this project, yet. I'll look into this tomorrow my time. |
@ahuth Also having a look today. Thanks all for the reports and notes! Will keep this updated with any results from investigations :-) |
I believe I have found the issue:
Will spend some time confirming and testing whether this is fully the case. Discovered this locally by opening a test on previous storybook packages and newest ones, navigating to the iframe view of the test, and checking for |
Good finds! Confirmed that updating storybook to 8.5.0 and including storybook-addon-a11y results in this issue. Also that not including storybook-addon-a11y "fixes" the issue. Haven't found a good way to resolve it yet, though 😐 |
Ideally there would be a way to intercept/modify the stories being tested. But, since we run I did find a solution that we can document here for the time-being. We can use
It took me a second to understand the storybook documentation on this; you need to add @mpelham @certainlyakey given your projects, would you be able to try this approach? |
Sure, I will try it out soon. Thank you for the research! On 23. Jan 2025, at 18:22, Andrew Holloway ***@***.***> wrote:
Ideally there would be a way to intercept/modify the stories being tested. But, since we run storybook build, then run axe-storybook-testing, the built tests already include the usage of @storybook/addons-a11y. It's very tricky and probably not possible to stop window.axe from being overwritten.
I did find a solution that we can document here for the time-being. We can use storybook build --test to disable the addon (and maybe other things...).
update the command to run storybook build --test && axe-storybook # or similar
in your main.(js|ts) file, add in the config you'd like to disable. In our case build: { test: { disabledAddons: ***@***.***/addon-a11y'] } }
re-run the script
It took me a second to understand the storybook documentation on this; you need to add --test which won't do anything until you ALSO add some changes to main.(js|ts)
@mpelham @certainlyakey given your projects, would you be able to try this approach?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi folks, The Storybook Core Maintaner here who broke your integration for Storybook 8.5 🙃👋 Via query parameters, the a11y addon can be deactivated by appending the following information to the URL when visiting a particular story http://localhost:6006/<story>?globals=a11y.manual:!true Then axe from addon-a11y will not run! Can you try this out? |
Hi @valentinpalkovic, thanks for the note! I'll try this out; sounds like it should work, even with stories that were built with the addon enabled. It's nice to have a few paths forward 💯 . Will update with results once I get another 2 seconds |
Documented using I have a local patch that can work without any config changes, using the tip from @valentinpalkovic (thanks again!). Will test that and work toward a PR including this change. cc @ahuth |
@booc0mtaco sorry for the delay, the |
And the latest version also resolved it for me. So i guess the issue can be closed now. |
Good to hear @certainlyakey . I wanted to add that documentation in case some other plugins (custom or otherwise) have a similar symptom (and to build something that may appear in search engine results). Let us know if you run into any other issues. |
Hey, thanks for the great tool!
I noticed that when it is used with a latest @storybook/addon-a11y (8.5.0), most of the tests fail with this error:
I discovered this comment. Considering that case, I found out when I go back to 8.4.7 for @storybook/addon-a11y (as well as all the other Storybook-related packages), the issue goes away.
Not sure if this will lead somewhere, and there's no documented issue yet for @storybook/addon-a11y itself.
The text was updated successfully, but these errors were encountered: