Emulate media in storybook tests #33774
iamallyniam
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I have code in components that'll only run if the user has set their preference to reduced motion in the OS. In playwright we have emulateMedia, that allows us to set the test to work as though someone has set their preference for reduced animation. Can this work in Storybook interaction tests? I realise these run in the browser where there's no browser API to emulate this for us. I've seen addons that will emulate user preferences in stories, but they're not optimised for Storybook 10.
Describe the solution you'd like
Ideally, I'd like to be able to set at a story level a media emulation
Describe alternatives you've considered
Exposing the
pagefrom playwright, or browser equivalent? This might be more difficult given the context the test is running inAre you able to assist to bring the feature to reality?
yes, I can
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions