-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Add step
function and support multiple levels of nesting
#18555
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 26ec0e6. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@tmeasday @shilman I'd like to get your 👍 on the decision to pass |
Hmm, I'm not sure we want to add that dependency. I wonder if we should have a (basically hidden) mechanism where addons can add fields to the story/play context? Although even if we do that there's a typing issue (how does |
step
function and support multiple levels of nesting
What would that mechanism look like? |
OK, let's go for something in between:
How does that sound @ghengeveld? |
What happens if someone sets up another addon which exports a step value like that? Do we compose them? I suppose if we default it to |
I was thinking it's just last one wins with maybe a warning. (Thus the undocumented). Unless you think composing makes more sense? |
@wKich this might be of interest to you. |
This should be rebased off |
One note about this change: it will break @storybook/testing-react and the like. The mechanism to get the step function ideally should be simple so it can be automated without the user doing anything |
@yannbf if the default is |
5caf14a
to
7970c89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@ghengeveld can you please review the chromatic change? |
The debugger seems broken right now. Need to investigate. |
@shilman This is good to go. Not sure what's up with cra-bench, seems like a Playwright or config issue unrelated to this PR. |
I suppose this needs to be added to the vite builder as well now, right? |
Oh! Yeah definitely. Did we miss this too? 🤦 |
What I did
Added a
step
function on theplay
function'scontext
object. Thestep
function effectively works like a Jestdescribe
block, where you provide a label and a callback function as arguments:Note that for the time being it's not possible to debug interactions inside a
step
function (similar towaitFor
). That's out of scope for this PR.How to test
If your answer is yes to any of these, please make sure to include it in your PR.