Skip to content

Conversation

shilman
Copy link

@shilman shilman commented Sep 18, 2025

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

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

Storybook testing docs are currently buried in the page contents. This change makes it visible in the right-hand table of contents.
Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: 02048bf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@shilman shilman changed the title Promote Storybook testing Promote Storybook testing to h2 Sep 18, 2025
@svelte-docs-bot
Copy link

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
Copy link
Author

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

Suggested change
## Component testing with Storybook
## Component testing using Storybook

@dummdidumm
Copy link
Member

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)

@shilman
Copy link
Author

shilman commented Sep 18, 2025

@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."

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@16792

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

Successfully merging this pull request may close these issues.

2 participants