Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/kasper/introduce-run' into kaspe…
Browse files Browse the repository at this point in the history
…r/introduce-run
  • Loading branch information
kasperpeulen committed Jul 31, 2024
2 parents f139626 + a6eea4b commit 9d2af7c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 42,644 deletions.
6 changes: 3 additions & 3 deletions docs/api/portable-stories/portable-stories-jest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ sidebar:
| argTypes | `ArgType` | The story's [argTypes](../arg-types.mdx) |
| id | `string` | The story's id |
| parameters | `Record<string, any>` | The story's [parameters](../parameters.mdx) |
| play | `(context) => Promise<void> \| undefined` | Executes the [play function](#3-play) of a given story |
| run | `(context) => Promise<void> \| undefined` | Mounts and executes the [play function](#3-play) of a given story |
| play | `(context) => Promise<void> \| undefined` | Executes the play function of a given story |
| run | `(context) => Promise<void> \| undefined` | [Mounts and executes the play function](#3-run) of a given story |
| storyName | `string` | The story's name |
| tags | `string[]` | The story's [tags](../../writing-stories/tags.mdx) |

Expand Down Expand Up @@ -219,7 +219,7 @@ sidebar:

### 3. Run

Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you run the `run` method of the composed story.
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.

👉 For this, you use the [`composeStories`](#composestories) or [`composeStory`](#composestory) API. The composed story will return a `run` method to be called.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/portable-stories/portable-stories-vitest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ sidebar:

### 3. Run

Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you run the `run` method of the composed story.
Finally, stories can prepare data they need (e.g. setting up some mocks or fetching data) before rendering by defining [loaders](../../writing-stories/loaders.mdx), [beforeEach](../../writing-tests/interaction-testing.mdx#run-code-before-each-story) or by having all the story code in the play function when using the [mount](../../writing-tests/interaction-testing.mdx#run-code-before-the-component-gets-rendered). In portable stories, all of these steps will be executed when you call the `run` method of the composed story.

👉 For this, you use the [`composeStories`](#composestories) or [`composeStory`](#composestory) API. The composed story will return a `run` method to be called.

Expand Down
Loading

0 comments on commit 9d2af7c

Please sign in to comment.