There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
feat(storybook): add not found page (#3767)
Alex Yang0df30e43c6ab
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex d1f0e0dd92..44423069f6 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -152,7 +152,7 @@ jobs:with:workingDir: apps/storybookbuildScriptName: build- onlyStoryNames: Preview/Core+ onlyStoryNames: 'Preview/**'projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}build-core:diff --git a/apps/storybook/src/stories/core.stories.tsx b/apps/storybook/src/stories/core.stories.tsxindex e8023e3e8a..22c0932065 100644--- a/apps/storybook/src/stories/core.stories.tsx+++ b/apps/storybook/src/stories/core.stories.tsx@@ -1,7 +1,7 @@import { routes } from '@affine/core/router';-import { expect } from '@storybook/jest';+import { assertExists } from '@blocksuite/global/utils';import type { StoryContext, StoryFn } from '@storybook/react';-import { userEvent } from '@storybook/testing-library';+import { userEvent, waitFor } from '@storybook/testing-library';import { Outlet, useLocation } from 'react-router-dom';import {reactRouterOutlets,@@ -27,7 +27,6 @@ export default {export const Index: StoryFn = () => {return <FakeApp />;};-Index.decorators = [withRouter, withCleanLocalStorage];Index.parameters = {reactRouter: reactRouterParameters({@@ -38,13 +37,20 @@ Index.parameters = {export const SettingPage: StoryFn = () => {return <FakeApp />;};-SettingPage.play = async ({ canvasElement }) => {- await new Promise(resolve => setTimeout(resolve, 1000));+ await waitFor(+ () => {+ assertExists(+ canvasElement.querySelector('[data-testid="settings-modal-trigger"]')+ );+ },+ {+ timeout: 5000,+ }+ );const settingModalBtn = canvasElement.querySelector('[data-testid="settings-modal-trigger"]') as Element;- expect(settingModalBtn).not.toBeNull();await userEvent.click(settingModalBtn);};SettingPage.decorators = [withRouter, withCleanLocalStorage];@@ -53,3 +59,16 @@ SettingPage.parameters = {routing: reactRouterOutlets(routes),}),};++export const NotFoundPage: StoryFn = () => {+ return <FakeApp />;+};+NotFoundPage.decorators = [withRouter, withCleanLocalStorage];+NotFoundPage.parameters = {+ reactRouter: reactRouterParameters({+ routing: reactRouterOutlets(routes),+ location: {+ path: '/404',+ },+ }),+};