-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Promote Storybook testing to h2 #16792
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
base: main
Are you sure you want to change the base?
Conversation
Storybook testing docs are currently buried in the page contents. This change makes it visible in the right-hand table of contents.
|
When writing component tests that involve two-way bindings, context or snippet props, it's best to create a wrapper component for your specific test and interact with that. `@testing-library/svelte` contains some [examples](https://testing-library.com/docs/svelte-testing-library/example). | ||
|
||
### Component testing with Storybook | ||
## Component testing with Storybook |
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.
For consistency with the other h2 headings
## Component testing with Storybook | |
## Component testing using Storybook |
I'm not too sure about this change. Logically it belongs to component testing because that's the context in which it is referenced. I hear you about the discover-in-the-side-nav-aspect - though I wonder if we should tackle this more generally by adjusting that nav bar to also show h3 entries. Would also make searching for things on other pages much easier (I hate the SvelteKit hooks page for that reason) |
@dummdidumm does the current structure actually make sense though? If the page was organized by test types you could put Storybook and Vitest as options underneath a component testing section. But it's currently organized as a peer to the component testing section, which is nested under "Unit and integration testing using Vitest." |
|
Storybook testing docs are currently buried in the page contents. This change makes it visible in the right-hand table of contents.
The current structure also nests Storybook under Vitest, which can be confusing to users. The fact that Storybook uses Vitest under the hood further confuses things. By promoting it to be a peer of Vitest and Playwright, where it belongs, this change should also improve clarity.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint