Skip to content
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

Add step to play context and runStep to project annotations #48

Merged
merged 17 commits into from
Oct 22, 2022

Conversation

tmeasday
Copy link
Contributor

@tmeasday tmeasday commented Jul 8, 2022

Add a step callback to the context of play functions, to allow grouping steps, or even reusing play functions from other stories:

export const MyStory = {
  play: ({ step }) {
     step('setup', SetupStory.play);
     step('first part', () => {
        await expect(...);
     });
  }
}

Also, add a runStep function to project annotations so an implementer (e.g. @storybook/addon-interactions) can hook into the step.

📦 Published PR as canary version: 0.0.2--canary.48.47fcdb1.0

✨ Test out this PR locally via:

npm install @storybook/csf@0.0.2--canary.48.47fcdb1.0
# or 
yarn add @storybook/csf@0.0.2--canary.48.47fcdb1.0

@tmeasday tmeasday requested a review from ghengeveld July 8, 2022 05:09
src/story.test.ts Outdated Show resolved Hide resolved
src/story.test.ts Outdated Show resolved Hide resolved
src/story.ts Outdated Show resolved Hide resolved
@shilman
Copy link
Contributor

shilman commented Jul 8, 2022

@tmeasday when y'all have settled on this, can you please update the PR description with the rationale for this?

src/story.test.ts Outdated Show resolved Hide resolved
@tmeasday tmeasday requested a review from ghengeveld July 9, 2022 00:20
@shilman shilman merged commit 47fcdb1 into 41-tighten-render-type Oct 22, 2022
@shilman shilman deleted the add-step branch October 22, 2022 08:39
@shilman
Copy link
Contributor

shilman commented Apr 3, 2023

🚀 PR was released in v0.1.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants