mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:31:49 +08:00
29 lines
811 B
Markdown
29 lines
811 B
Markdown
```tsx filename="Button.test.tsx" renderer="react" language="ts"
|
|
import { test } from '@jest/globals';
|
|
// 👉 Using Next.js? Import from @storybook/nextjs instead
|
|
import { composeStories } from '@storybook/react';
|
|
|
|
import * as stories from './Button.stories';
|
|
|
|
const { Primary } = composeStories(stories);
|
|
|
|
test('renders and executes the play function', async () => {
|
|
// Mount story and run interactions
|
|
await Primary.run();
|
|
});
|
|
```
|
|
|
|
```ts filename="Button.test.ts" renderer="vue" language="ts"
|
|
import { test } from '@jest/globals';
|
|
import { composeStories } from '@storybook/vue3';
|
|
|
|
import * as stories from './Button.stories';
|
|
|
|
const { Primary } = composeStories(stories);
|
|
|
|
test('renders and executes the play function', async () => {
|
|
// Mount story and run interactions
|
|
await Primary.run();
|
|
});
|
|
```
|