mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-20 05:02:37 +08:00
807 B
807 B
title |
---|
Interaction testing with Storybook |
Stories are useful for verifying the known states of a component. But sometimes you need to test how a component changes in response to user interaction.
Stories are convenient starting points and harnesses for interaction tests using end-to-end tools like Enzyme and Cypress.
Luckily, this is straightforward. Point your interaction testing tool at Storybook’s isolated iframe URL for a specific story then execute the test script as usual. Here’s an example using Cypress:
<CodeSnippets paths={[ 'common/component-cypress-test.js.mdx', ]} />