Docs: Add afterEach guidance#32156
Merged
Merged
Conversation
Comment on lines
+154
to
+156
| async afterEach(context) { | ||
| console.log(`✅ Tested ${context.name} story`); | ||
| }, |
Contributor
There was a problem hiding this comment.
style: Inconsistent emoji usage - only the web-components JS example includes ✅ emoji while others don't
Suggested change
| async afterEach(context) { | |
| console.log(`✅ Tested ${context.name} story`); | |
| }, | |
| async afterEach(context) { | |
| console.log(`Tested ${context.name} story`); | |
| }, |
|
View your CI Pipeline Execution ↗ for commit 8a3bc56
☁️ Nx Cloud last updated this comment at |
|
You mention running accessibility tests in |
4af3ae4 to
f08fe97
Compare
Contributor
Author
|
@Stadly — I only included that as an example of what could be done. However, that's probably more confusing than helpful, as we already have a way to do a11y checks: addon-a11y. I've changed the explanation to avoid that confusion. |
kasperpeulen
approved these changes
Aug 2, 2025
This was referenced Aug 5, 2025
Merged
yannbf
pushed a commit
that referenced
this pull request
Aug 11, 2025
Docs: Add `afterEach` guidance (cherry picked from commit b6edefe)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Add guidance for the
afterEachfunctionChecklist for Contributors
Testing
Manual testing
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.Greptile Summary
This PR adds comprehensive documentation for the
afterEachfunction in Storybook's interaction testing capabilities. The changes include:Main Documentation Updates:
docs/writing-tests/interaction-testing.mdxexplaining theafterEachlifecycle hookafterEachruns after story rendering and play function completionCode Examples:
docs/_snippets/after-each-in-meta.mdwith comprehensive examples across all supported frameworksThe documentation integrates well with Storybook's existing testing infrastructure, as evidenced by the
afterEachfunction already being used internally by the a11y addon for accessibility testing. This PR fills a documentation gap for a feature that exists and is actively used within Storybook's ecosystem, making it available for end users who need post-interaction testing capabilities.Confidence score: 5/5
Context used:
Context - When documenting code snippets, ensure to include Svelte CSF and CSF examples, and also include JS and TypeScript variants. (link)