Skip to content
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

Docs: Vitest plugin #28924

Merged
merged 18 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/_snippets/addon-vitest-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```shell renderer="common" language="js" packageManager="npx"
npx storybook@latest add @storybook/experimental-addon-vitest
```

```shell renderer="common" language="js" packageManager="pnpm"
pnpm dlx storybook@latest add @storybook/experimental-addon-vitest
```

```shell renderer="common" language="js" packageManager="yarn"
yarn dlx storybook@latest add @storybook/experimental-addon-vitest
```
11 changes: 11 additions & 0 deletions docs/_snippets/addon-vitest-run-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```shell renderer="common" language="js" packageManager="npm"
npm run test
```

```shell renderer="common" language="js" packageManager="pnpm"
pnpm run test
```

```shell renderer="common" language="js" packageManager="yarn"
yarn test
```
kylegach marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion docs/api/portable-stories/portable-stories-jest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Portable stories in Jest'
sidebar:
title: Jest
order: 1
order: 2
---

<If notRenderer={['react', 'vue']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Portable stories in Playwright CT'
sidebar:
title: Playwright
order: 2
order: 3
---

(⚠️ **Experimental**)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/portable-stories/portable-stories-vitest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Portable stories in Vitest'
sidebar:
title: Vitest
order: 0
order: 1
---

<If notRenderer={['react', 'vue', 'svelte']}>
Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/accessibility-testing.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Accessibility tests'
sidebar:
order: 3
order: 4
title: Accessibility tests
---

Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/import-stories-in-tests/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Import stories in tests
sidebar:
order: 7
order: 8
title: Import stories in tests
---
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Stories in end-to-end tests'
sidebar:
title: End-to-end tests
order: 1
order: 2
---

Storybook seamlessly integrates with additional testing frameworks like [Cypress](https://www.cypress.io/) and [Playwright](https://playwright.dev/) to provide a comprehensive testing solution. By leveraging the Component Story Format (CSF), developers can write test cases that simulate user interactions and verify the behavior of individual components within the Storybook environment. This approach enables developers to thoroughly test their components' functionality, responsiveness, and visual appearance across different scenarios, resulting in more robust and reliable applications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 'Stories in unit tests'
sidebar:
title: Unit tests
order: 0
order: 1
---

Teams test a variety of UI characteristics using different tools. Each tool requires you to replicate the same component state over and over. That’s a maintenance headache. Ideally, you’d set up your tests similarly and reuse that across tools.
Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/interaction-testing.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Interaction tests'
sidebar:
order: 4
order: 5
title: Interaction tests
---

Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/snapshot-testing/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Snapshot testing
sidebar:
order: 6
order: 7
title: Snapshot testing
---
2 changes: 2 additions & 0 deletions docs/writing-tests/snapshot-testing/snapshot-testing.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: 'Write snapshot tests'
sidebar:
order: 1
---

Snapshot tests compare the rendered markup of every story against known baselines. It’s a way to identify markup changes that trigger rendering errors and warnings.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: 'Storyshots migration guide'
sidebar:
order: 2
---

<Callout variant="info" style={{ marginBottom: "2rem" }}>
Expand Down
2 changes: 1 addition & 1 deletion docs/writing-tests/test-coverage.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Test coverage'
sidebar:
order: 5
order: 6
title: Test coverage
---

Expand Down
Loading
Loading