mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
27 lines
651 B
Plaintext
27 lines
651 B
Plaintext
```js
|
|
// MyComponent.stories.js
|
|
|
|
import { screen, userEvent } from '@storybook/testing-library';
|
|
|
|
import MyComponent from './MyComponent.svelte';
|
|
|
|
export default {
|
|
component: MyComponent,
|
|
};
|
|
|
|
export const CombinedStories = {
|
|
...FirstStory,
|
|
play: async () => {
|
|
// The delay option set the ammount of milliseconds between characters being typed
|
|
await userEvent.type(screen.getByTestId('example-element'), 'random string', {
|
|
delay: 100,
|
|
});
|
|
await userEvent.type(screen.getByTestId('another-example-element'), 'another random string', {
|
|
delay: 100,
|
|
});
|
|
},
|
|
render: () => ({
|
|
Component: MyComponent,
|
|
}),
|
|
};
|
|
``` |