mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 21:31:48 +08:00
27 lines
648 B
Plaintext
27 lines
648 B
Plaintext
```ts
|
|
// Button.test.ts
|
|
import { composeStories } from '@storybook/vue3';
|
|
|
|
import * as stories from './Button.stories';
|
|
|
|
const { CSF3Primary } = composeStories(stories);
|
|
|
|
describe('<Button />', () => {
|
|
it('renders with loaders and play function', () => {
|
|
cy.then(async () => {
|
|
await CSF3Primary.load();
|
|
});
|
|
|
|
cy.mount(CSF3Primary());
|
|
|
|
cy.then(async () => {
|
|
await CSF3Primary.play({
|
|
// data-cy-root is Cypress "App". The top-most wrapping element
|
|
canvasElement: document.querySelector('[data-cy-root]'),
|
|
});
|
|
// Cypress assertions happen inside of this scope, after play
|
|
});
|
|
});
|
|
});
|
|
```
|