mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
feat(storybook): import plugins (#3768)
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
"exports": {
|
||||
"./app": "./src/app.tsx",
|
||||
"./router": "./src/router.ts",
|
||||
"./bootstrap/setup": "./src/bootstrap/setup.ts"
|
||||
"./bootstrap/setup": "./src/bootstrap/setup.ts",
|
||||
"./bootstrap/register-plugins": "./src/bootstrap/register-plugins.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@affine-test/fixtures": "workspace:*",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'ses';
|
||||
import '@affine/component/theme/global.css';
|
||||
import '@affine/component/theme/theme.css';
|
||||
import '@toeverything/components/style.css';
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"concurrently": "^8.2.0",
|
||||
"jest-mock": "^29.6.2",
|
||||
"serve": "^14.2.0",
|
||||
"ses": "^0.18.7",
|
||||
"storybook": "^7.2.3",
|
||||
"storybook-dark-mode": "^3.0.1",
|
||||
"wait-on": "^7.0.1"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { pluginRegisterPromise } from '@affine/core/bootstrap/register-plugins';
|
||||
import { routes } from '@affine/core/router';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { StoryContext, StoryFn } from '@storybook/react';
|
||||
import { userEvent, waitFor } from '@storybook/testing-library';
|
||||
import { use } from 'foxact/use';
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
import {
|
||||
reactRouterOutlets,
|
||||
@@ -25,6 +27,7 @@ export default {
|
||||
};
|
||||
|
||||
export const Index: StoryFn = () => {
|
||||
use(pluginRegisterPromise);
|
||||
return <FakeApp />;
|
||||
};
|
||||
Index.decorators = [withRouter, withCleanLocalStorage];
|
||||
|
||||
Reference in New Issue
Block a user