You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
addons: [
'@storybook/addon-essentials',
'@storybook/addon-themes',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'storybook-addon-pseudo-states', // force component state, eg: `:hover`,`:focus`, not support for nested elements
],
import{composeStories,composeStory}from'@storybook/react';import*asstoriesfrom'@/stories/basic/inputs/Button.stories';importuserEventfrom'@testing-library/user-event';const{ Loading }=composeStories(stories);describe('Button Component',()=>{constmockOnClick=vi.fn();beforeEach(()=>{mockOnClick.mockReset();});it('does not call onClick when loading',async()=>{awaitLoading.run();userEvent.click(screen.getByRole('button'));expect(mockOnClick).not.toHaveBeenCalled();});
when i change to:
it('does not call onClick when loading',async()=>{// await Loading.run({// args: {// onClick: mockOnClick,// },// });render(<ButtononClick={mockOnClick}disabled={true}>LoadingButton</Button>,
);userEvent.click(screen.getByRole('button'));expect(mockOnClick).not.toHaveBeenCalled();});
Describe the bug
flow the doc: https://github.com/storybookjs/storybook/blob/next/code/addons/themes/docs/getting-started/material-ui.md
my main.js:
and my preview.js:
only use in test file , will show error:
my test file:
when i change to:
it's worked
Reproduction link
sorry, i don't have
Reproduction steps
No response
System
Additional context
No response
The text was updated successfully, but these errors were encountered: