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 12 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-test-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 add @storybook/experimental-addon-test
```

```shell renderer="common" language="js" packageManager="pnpm"
pnpm exec storybook add @storybook/experimental-addon-test
```

```shell renderer="common" language="js" packageManager="yarn"
yarn exec storybook add @storybook/experimental-addon-test
```
11 changes: 11 additions & 0 deletions docs/_snippets/addon-test-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
```
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
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/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Storybook also comes with tools, [a test runner](./test-runner.mdx), and handy i
* [Test runner](./test-runner.mdx) to automate test execution
* [Test coverage](./test-coverage.mdx) for measuring code coverage
* [End-to-end tests](./import-stories-in-tests/stories-in-end-to-end-tests.mdx) for simulating real user scenarios
* [**Unit tests**](./import-stories-in-tests/stories-in-unit-tests.mdx) for functionality
* [Unit tests](./import-stories-in-tests/stories-in-unit-tests.mdx) for functionality
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: '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
Loading