Skip to content

Commit

Permalink
feat: 스토리북에 토스트 루트 엘리먼트를 추가하는 데코레이터 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
bassyu authored and hozzijeong committed Jul 27, 2023
1 parent 167954b commit 4dcadc0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Preview } from '@storybook/react';
import { initialize, mswLoader } from 'msw-storybook-addon';
import { storybookHandlers } from '../src/mocks/storybookHandlers';
import { decorateGlobalStyle, decorateToastRoot } from './decorators';

initialize({
serviceWorker: {
url: `${process.env.PUBLIC_URL}/mockServiceWorker.js`,
},
onUnhandledRequest: 'bypass',
});

const preview: Preview = {
decorators: [decorateGlobalStyle, decorateToastRoot],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},

msw: { handlers: [...storybookHandlers] },
},

loaders: [mswLoader],
};

export default preview;

0 comments on commit 4dcadc0

Please sign in to comment.