> **Version 8** — **React** / **TypeScript**
> Also available:
- `?codeOnly=true` for code snippets only
- other versions: Version 10.6 (latest) (`/docs/writing-tests.md`), Version 11 (alpha) (`/docs/11/writing-tests.md`), Version 9 (`/docs/9/writing-tests.md`)

# How to test UIs with Storybook

Storybook provides a clean-room environment for testing components in isolation. Stories make it easy to explore a component in all its variations, no matter how complex.

That means stories are a pragmatic starting point for your UI testing strategy. You already write stories as a natural part of UI development, testing those stories is a low-effort way to prevent UI bugs over time.

The simplest testing method is manual “spot checking”. You run Storybook locally, then eyeball every story to verify its appearance and behavior. [Publish](https://storybook.js.org/docs/8/sharing/publish-storybook.md) your Storybook online to share reproductions and get teammates involved.

To test a component in isolation, you often have to mock data, dependencies, or even network requests. Check out our guide on [mocking in Storybook](https://storybook.js.org/docs/8/writing-stories/build-pages-with-storybook.md#mocking-connected-components) for more info.

Storybook also comes with tools, [a test runner](https://storybook.js.org/docs/8/writing-tests/test-runner.md), and handy integrations with the larger JavaScript ecosystem to expand your UI test coverage. These docs detail how you can use Storybook for UI testing.

* [Component tests](https://storybook.js.org/docs/8/writing-tests/component-testing.md) for user behavior simulation
* [Visual tests](https://storybook.js.org/docs/8/writing-tests/visual-testing.md) for appearance
* [Accessibility tests](https://storybook.js.org/docs/8/writing-tests/accessibility-testing.md) for accessibility
* [Snapshot tests](https://storybook.js.org/docs/8/writing-tests/snapshot-testing/snapshot-testing.md) for rendering errors and warnings
* [Test runner](https://storybook.js.org/docs/8/writing-tests/test-runner.md) to automate test execution
* [Test coverage](https://storybook.js.org/docs/8/writing-tests/test-coverage.md) for measuring code coverage
* [End-to-end tests](https://storybook.js.org/docs/8/writing-tests/import-stories-in-tests/stories-in-end-to-end-tests.md) for simulating real user scenarios
* [Unit tests](https://storybook.js.org/docs/8/writing-tests/import-stories-in-tests/stories-in-unit-tests.md) for functionality