-
-
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.
|
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." |
|
If you look at this purely from a topical POV and assume the user has a specific testing strategy in mind when reading the docs, I could suggest a structure like this: Unit TestingWhy unit tests are good, and when Using Vitest
Component1 TestingWhy component tests are good, and when Using Vitest
Using Storybook
E2E TestingWhy E2E tests are good, and when Using Playwright
However the structure above has a few downsides:
Which brings me to something very close to what is there today: Concise summary of unit, component and E2E tests, when to consider which and how they differ. Unit and Component Testing with Vitest
Component Testing with Storybook
E2E Testing with Playwright
This approach structures the docs around the tools rather than the testing types, while still providing an overview of the testing types via the intro and headings. Maybe this is better? At least it's the most clear structure I can imagine right now. Maybe @dominikg has input as well. Footnotes
|
I like that structure @JReinhold. I also think we should change 'E2E' to 'End-to-end', since we shouldn't assume everyone is versed in the acronym (it's also just nicer, aesthetically, in the context of a title) and change 'testing' to 'tests'. So we'd end up with this: ![]() |
Thanks @Rich-Harris @JReinhold and @dummdidumm. I've updated the PR with your heading suggestions! |
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