From 4dcadc0b93760530e830383f3f8be00c950104a7 Mon Sep 17 00:00:00 2001 From: bassyu Date: Tue, 18 Jul 2023 13:03:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=B6=81?= =?UTF-8?q?=EC=97=90=20=ED=86=A0=EC=8A=A4=ED=8A=B8=20=EB=A3=A8=ED=8A=B8=20?= =?UTF-8?q?=EC=97=98=EB=A6=AC=EB=A8=BC=ED=8A=B8=EB=A5=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=98=EB=8A=94=20=EB=8D=B0=EC=BD=94=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.storybook/preview.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 frontend/.storybook/preview.ts diff --git a/frontend/.storybook/preview.ts b/frontend/.storybook/preview.ts new file mode 100644 index 000000000..979820fc6 --- /dev/null +++ b/frontend/.storybook/preview.ts @@ -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;