From 9853d0f6ef2ab10562b451a877217cea0be9164b Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Wed, 16 Aug 2023 21:44:48 -0500 Subject: [PATCH] fix: disable unstable snapshot (#3791) --- apps/storybook/src/stories/breadcrumbs.stories.tsx | 3 +++ apps/storybook/src/stories/card.stories.tsx | 6 +++++- apps/storybook/src/stories/import-page.stories.tsx | 3 +++ apps/storybook/src/stories/notification-center.stories.tsx | 3 +++ apps/storybook/src/stories/onboarding-modal.stories.tsx | 7 +++++-- .../storybook/src/stories/page-detail-skeleton.stories.tsx | 3 +++ apps/storybook/src/stories/page-list.stories.tsx | 4 ++-- apps/storybook/src/stories/share-menu.stories.tsx | 7 +++++-- apps/storybook/src/stories/switch.stories.tsx | 7 +++++-- apps/storybook/src/stories/workspace-avatar.stories.tsx | 3 +++ apps/storybook/src/stories/workspace-list.stories.tsx | 3 +++ 11 files changed, 40 insertions(+), 9 deletions(-) diff --git a/apps/storybook/src/stories/breadcrumbs.stories.tsx b/apps/storybook/src/stories/breadcrumbs.stories.tsx index e9b2e25b65..6136b5e7d2 100644 --- a/apps/storybook/src/stories/breadcrumbs.stories.tsx +++ b/apps/storybook/src/stories/breadcrumbs.stories.tsx @@ -7,6 +7,9 @@ import { within } from '@storybook/testing-library'; export default { title: 'AFFiNE/Breadcrumbs', component: Breadcrumbs, + parameters: { + chromatic: { disableSnapshot: true }, + }, } as Meta; const Template: StoryFn = args => ; diff --git a/apps/storybook/src/stories/card.stories.tsx b/apps/storybook/src/stories/card.stories.tsx index ef1d5cffb3..1d73578cba 100644 --- a/apps/storybook/src/stories/card.stories.tsx +++ b/apps/storybook/src/stories/card.stories.tsx @@ -9,11 +9,15 @@ import { HelpIcon, PageIcon, } from '@blocksuite/icons'; +import type { Meta } from '@storybook/react'; export default { title: 'AFFiNE/Card', component: WorkspaceCard, -}; + parameters: { + chromatic: { disableSnapshot: true }, + }, +} satisfies Meta; const blockSuiteWorkspace = getOrCreateWorkspace( 'blocksuite-local', diff --git a/apps/storybook/src/stories/import-page.stories.tsx b/apps/storybook/src/stories/import-page.stories.tsx index 37867a60c1..8082cf2635 100644 --- a/apps/storybook/src/stories/import-page.stories.tsx +++ b/apps/storybook/src/stories/import-page.stories.tsx @@ -7,6 +7,9 @@ import type { Meta } from '@storybook/react'; export default { title: 'AFFiNE/ImportPage', component: ImportPage, + parameters: { + chromatic: { disableSnapshot: true }, + }, } satisfies Meta; const Template: StoryFn = args => ; diff --git a/apps/storybook/src/stories/notification-center.stories.tsx b/apps/storybook/src/stories/notification-center.stories.tsx index 3b2af6ac7e..b3f2fca449 100644 --- a/apps/storybook/src/stories/notification-center.stories.tsx +++ b/apps/storybook/src/stories/notification-center.stories.tsx @@ -9,6 +9,9 @@ import { useAtomValue, useSetAtom } from 'jotai'; export default { title: 'AFFiNE/NotificationCenter', component: NotificationCenter, + parameters: { + chromatic: { disableSnapshot: true }, + }, } satisfies Meta; let id = 0; diff --git a/apps/storybook/src/stories/onboarding-modal.stories.tsx b/apps/storybook/src/stories/onboarding-modal.stories.tsx index 976747e06c..13c818963a 100644 --- a/apps/storybook/src/stories/onboarding-modal.stories.tsx +++ b/apps/storybook/src/stories/onboarding-modal.stories.tsx @@ -1,11 +1,14 @@ /* deepscan-disable USELESS_ARROW_FUNC_BIND */ import { TourModal } from '@affine/component/tour-modal'; -import type { StoryFn } from '@storybook/react'; +import type { Meta, StoryFn } from '@storybook/react'; export default { title: 'AFFiNE/TourModal', component: TourModal, -}; + parameters: { + chromatic: { disableSnapshot: true }, + }, +} satisfies Meta; export const Basic: StoryFn = () => { return {}} />; diff --git a/apps/storybook/src/stories/page-detail-skeleton.stories.tsx b/apps/storybook/src/stories/page-detail-skeleton.stories.tsx index dae18b57b5..dd9c3238b9 100644 --- a/apps/storybook/src/stories/page-detail-skeleton.stories.tsx +++ b/apps/storybook/src/stories/page-detail-skeleton.stories.tsx @@ -4,6 +4,9 @@ import type { Meta } from '@storybook/react'; export default { title: 'AFFiNE/PageDetailSkeleton', component: PageDetailSkeleton, + parameters: { + chromatic: { disableSnapshot: true }, + }, } satisfies Meta; export const Basic = () => { diff --git a/apps/storybook/src/stories/page-list.stories.tsx b/apps/storybook/src/stories/page-list.stories.tsx index b3ef056fc0..662f0b1581 100644 --- a/apps/storybook/src/stories/page-list.stories.tsx +++ b/apps/storybook/src/stories/page-list.stories.tsx @@ -7,7 +7,7 @@ import { NewPageButton } from '@affine/component/page-list'; import { OperationCell } from '@affine/component/page-list'; import { PageIcon } from '@blocksuite/icons'; import { expect } from '@storybook/jest'; -import type { StoryFn } from '@storybook/react'; +import type { Meta, StoryFn } from '@storybook/react'; import { userEvent } from '@storybook/testing-library'; export default { @@ -16,7 +16,7 @@ export default { parameters: { chromatic: { disableSnapshot: true }, }, -}; +} satisfies Meta; export const AffineOperationCell: StoryFn = ({ ...props diff --git a/apps/storybook/src/stories/share-menu.stories.tsx b/apps/storybook/src/stories/share-menu.stories.tsx index b1054a2871..3b989a0a23 100644 --- a/apps/storybook/src/stories/share-menu.stories.tsx +++ b/apps/storybook/src/stories/share-menu.stories.tsx @@ -12,14 +12,17 @@ import { WorkspaceFlavour } from '@affine/env/workspace'; import { getOrCreateWorkspace } from '@affine/workspace/manager'; import type { Page } from '@blocksuite/store'; import { expect } from '@storybook/jest'; -import type { StoryFn } from '@storybook/react'; +import type { Meta, StoryFn } from '@storybook/react'; import { use } from 'foxact/use'; import { useState } from 'react'; export default { title: 'AFFiNE/ShareMenu', component: ShareMenu, -}; + parameters: { + chromatic: { disableSnapshot: true }, + }, +} satisfies Meta; async function initPage(page: Page) { await page.waitForLoaded(); diff --git a/apps/storybook/src/stories/switch.stories.tsx b/apps/storybook/src/stories/switch.stories.tsx index 4661cf075f..ebad9bb6aa 100644 --- a/apps/storybook/src/stories/switch.stories.tsx +++ b/apps/storybook/src/stories/switch.stories.tsx @@ -1,11 +1,14 @@ /* deepscan-disable USELESS_ARROW_FUNC_BIND */ import { Switch } from '@affine/component'; -import type { StoryFn } from '@storybook/react'; +import type { Meta, StoryFn } from '@storybook/react'; export default { title: 'AFFiNE/Switch', component: Switch, -}; + parameters: { + chromatic: { disableSnapshot: true }, + }, +} satisfies Meta; export const Basic: StoryFn = () => { return Switch; diff --git a/apps/storybook/src/stories/workspace-avatar.stories.tsx b/apps/storybook/src/stories/workspace-avatar.stories.tsx index bf7a30e998..ead6128f7c 100644 --- a/apps/storybook/src/stories/workspace-avatar.stories.tsx +++ b/apps/storybook/src/stories/workspace-avatar.stories.tsx @@ -16,6 +16,9 @@ export default { }, }, }, + parameters: { + chromatic: { disableSnapshot: true }, + }, } satisfies Meta; const schema = new Schema(); diff --git a/apps/storybook/src/stories/workspace-list.stories.tsx b/apps/storybook/src/stories/workspace-list.stories.tsx index 82647634e6..270e4ae453 100644 --- a/apps/storybook/src/stories/workspace-list.stories.tsx +++ b/apps/storybook/src/stories/workspace-list.stories.tsx @@ -9,6 +9,9 @@ import { useState } from 'react'; export default { title: 'AFFiNE/WorkspaceList', component: WorkspaceList, + parameters: { + chromatic: { disableSnapshot: true }, + }, } satisfies Meta; export const Default = () => {