Open hamsteven opened 2 months ago
if (Platform.OS="web")
the play function isn't fully supported for nativeFor react native itself the best you can do is unit tests with composeStories or write explicit integration tests with maestro or detox etc
Describe the bug
I have shared stories for storybook for web and storybook for react-native. They all contain the play function for interaction testing. The
@storybook/test
import int the stories fails the bundling process for web and native when starting up storybook for react-native.Using https://storybook.js.org/addons/@storybook/addon-interactions for web breaks my react-native implementation of storybook. If I comment out the line below and mock out those imports then everything starts normally.
The line in my stories that breaks the app (both my normal app and storybook for react native) and causes the terminal to hang:
import { userEvent, within, expect, fn, waitFor } from "@storybook/test";
The addon-interactions addon is not in the react-native config and I just have it in my web storybook as seen below. The bundling goes to 100% but the terminal locks up and my expo app locks up on startup at the same time:
Eventually I get "There was a problem loading the project" in my ios simulator.
When I add the addon-interactions addon to my react-native storybook like below:
then I get the following error:
How do I work around this where I can use one story for both react and react-native versions of storybook?
To Reproduce
I went by Danny's implementation of both react and react-native side-by-side storybook example.
System
Additional context
... "storybook": "^8.0.6",