mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Fix unit tests
This commit is contained in:
parent
23dd715bd0
commit
353ff45133
@ -1,7 +1,7 @@
|
|||||||
// @vitest-environment happy-dom
|
// @vitest-environment happy-dom
|
||||||
/// <reference types="@testing-library/jest-dom" />;
|
/// <reference types="@testing-library/jest-dom" />;
|
||||||
import { render, screen } from '@testing-library/vue';
|
import { cleanup, render, screen } from '@testing-library/vue';
|
||||||
import { describe, expect, it, vi } from 'vitest';
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||||
|
|
||||||
import { addons } from 'storybook/internal/preview-api';
|
import { addons } from 'storybook/internal/preview-api';
|
||||||
|
|
||||||
@ -21,6 +21,10 @@ const { CSF3Primary, LoaderStory } = composeStories(stories);
|
|||||||
// example with composeStory, returns a single story composed with args/decorators
|
// example with composeStory, returns a single story composed with args/decorators
|
||||||
const Secondary = composeStory(stories.CSF2Secondary, stories.default);
|
const Secondary = composeStory(stories.CSF2Secondary, stories.default);
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
cleanup();
|
||||||
|
});
|
||||||
|
|
||||||
describe('renders', () => {
|
describe('renders', () => {
|
||||||
it('renders primary button', () => {
|
it('renders primary button', () => {
|
||||||
render(CSF3Primary, { props: { label: 'Hello world' } });
|
render(CSF3Primary, { props: { label: 'Hello world' } });
|
||||||
|
@ -10,8 +10,5 @@ export default mergeConfig(
|
|||||||
defineConfig({
|
defineConfig({
|
||||||
// @ts-expect-error seems like there's a type mismatch in the vue plugin
|
// @ts-expect-error seems like there's a type mismatch in the vue plugin
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
test: {
|
|
||||||
globals: true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user