mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
19 lines
444 B
Plaintext
19 lines
444 B
Plaintext
```ts
|
|
// Button.test.ts
|
|
import { test } from 'vitest';
|
|
import { render } from '@testing-library/vue';
|
|
import { composeStory } from '@storybook/vue3';
|
|
|
|
import meta, { Primary } from './Button.stories';
|
|
|
|
test('renders and executes the play function', async () => {
|
|
const PrimaryStory = composeStory(Primary, meta);
|
|
|
|
// First, render the story
|
|
render(PrimaryStory);
|
|
|
|
// Then, execute the play function
|
|
await PrimaryStory.play();
|
|
});
|
|
```
|