storybook/docs/snippets/vue/portable-stories-vitest-with-loaders.ts.mdx
Kyle Gach e09480aefb Split into three separate pages
- Organizational and prose improvements
- Remove Cypress, for now
2024-02-27 11:09:42 -07:00

19 lines
443 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('applies the loaders and renders', async () => {
const PrimaryStory = composeStory(Primary, meta);
// First, load the data for the story
await PrimaryStory.load();
// Then, render the story
render(PrimaryStory());
});
```