-
-
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
Chore: (Docs) Writing stories section #16236
Conversation
Nx Cloud ReportCI ran the following commands for commit e3bf61c. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
|
||
When Storybook loads the story, it interacts with the component, filling in its inputs and triggering any validation logic defined. | ||
|
||
## Working with events |
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.
It seems like this section and the prior one should flip in order, as this one (sort of) serves as an introduction to userEvent
& fireEvent
, but the prior one uses userEvent
.
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.
Actually, I had a different thought after shifting from reviewing the words to the snippets...
I think we should combine these two sections, and point to how you can use testing-library packages to query for elements. This has a couple benefits:
- It avoids the order issue I commented on
- It allows us to jump straight into the most appropriate method of querying for elements
- Querying by
data-testid
is a last resort, according to testing-library best practices, and we should not be encouraging it in our snippets, imo
- Querying by
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.
@kylegach With the latest commit, I've condensed the two sections and expanded the examples a bit. Let me know
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.
Much better! Nice job reworking them into a a better narrative flow. I left a few more comments.
…rybookjs/storybook into chore_polish_writing_stories
docs/snippets/react/my-component-play-function-with-clickevent.js.mdx
Outdated
Show resolved
Hide resolved
docs/snippets/react/my-component-play-function-with-clickevent.js.mdx
Outdated
Show resolved
Hide resolved
docs/snippets/react/my-component-play-function-with-selectevent.js.mdx
Outdated
Show resolved
Hide resolved
docs/snippets/react/my-component-play-function-with-selectevent.js.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Kyle Gach <kyle.gach@gmail.com>
….js.mdx Co-authored-by: Kyle Gach <kyle.gach@gmail.com>
Co-authored-by: Kyle Gach <kyle.gach@gmail.com>
Co-authored-by: Kyle Gach <kyle.gach@gmail.com>
…rybookjs/storybook into chore_polish_writing_stories
Self merging this |
With this pull request the writing stories is updated in light of the changes required for 6.4, follows up on #15519.
What was done:
One item of feedback. The play function's snippets are placeholders and will require adjustments per the
addon-interactions
release. @ghengeveld I'll follow up with you on this.@kylegach if you'd be so kind to take a look and let me know of any feedback you might encounter.
Feel free to provide feedback.