fix: disable unstable snapshot (#3791)

This commit is contained in:
Alex Yang
2023-08-16 21:44:48 -05:00
committed by GitHub
parent 9d723fd487
commit 9853d0f6ef
11 changed files with 40 additions and 9 deletions

View File

@@ -7,6 +7,9 @@ import { within } from '@storybook/testing-library';
export default { export default {
title: 'AFFiNE/Breadcrumbs', title: 'AFFiNE/Breadcrumbs',
component: Breadcrumbs, component: Breadcrumbs,
parameters: {
chromatic: { disableSnapshot: true },
},
} as Meta<typeof Breadcrumbs>; } as Meta<typeof Breadcrumbs>;
const Template: StoryFn = args => <Breadcrumbs {...args} />; const Template: StoryFn = args => <Breadcrumbs {...args} />;

View File

@@ -9,11 +9,15 @@ import {
HelpIcon, HelpIcon,
PageIcon, PageIcon,
} from '@blocksuite/icons'; } from '@blocksuite/icons';
import type { Meta } from '@storybook/react';
export default { export default {
title: 'AFFiNE/Card', title: 'AFFiNE/Card',
component: WorkspaceCard, component: WorkspaceCard,
}; parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta;
const blockSuiteWorkspace = getOrCreateWorkspace( const blockSuiteWorkspace = getOrCreateWorkspace(
'blocksuite-local', 'blocksuite-local',

View File

@@ -7,6 +7,9 @@ import type { Meta } from '@storybook/react';
export default { export default {
title: 'AFFiNE/ImportPage', title: 'AFFiNE/ImportPage',
component: ImportPage, component: ImportPage,
parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta; } satisfies Meta;
const Template: StoryFn<typeof ImportPage> = args => <ImportPage {...args} />; const Template: StoryFn<typeof ImportPage> = args => <ImportPage {...args} />;

View File

@@ -9,6 +9,9 @@ import { useAtomValue, useSetAtom } from 'jotai';
export default { export default {
title: 'AFFiNE/NotificationCenter', title: 'AFFiNE/NotificationCenter',
component: NotificationCenter, component: NotificationCenter,
parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta<typeof NotificationCenter>; } satisfies Meta<typeof NotificationCenter>;
let id = 0; let id = 0;

View File

@@ -1,11 +1,14 @@
/* deepscan-disable USELESS_ARROW_FUNC_BIND */ /* deepscan-disable USELESS_ARROW_FUNC_BIND */
import { TourModal } from '@affine/component/tour-modal'; import { TourModal } from '@affine/component/tour-modal';
import type { StoryFn } from '@storybook/react'; import type { Meta, StoryFn } from '@storybook/react';
export default { export default {
title: 'AFFiNE/TourModal', title: 'AFFiNE/TourModal',
component: TourModal, component: TourModal,
}; parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta;
export const Basic: StoryFn = () => { export const Basic: StoryFn = () => {
return <TourModal open={true} onClose={() => {}} />; return <TourModal open={true} onClose={() => {}} />;

View File

@@ -4,6 +4,9 @@ import type { Meta } from '@storybook/react';
export default { export default {
title: 'AFFiNE/PageDetailSkeleton', title: 'AFFiNE/PageDetailSkeleton',
component: PageDetailSkeleton, component: PageDetailSkeleton,
parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta<typeof PageDetailSkeleton>; } satisfies Meta<typeof PageDetailSkeleton>;
export const Basic = () => { export const Basic = () => {

View File

@@ -7,7 +7,7 @@ import { NewPageButton } from '@affine/component/page-list';
import { OperationCell } from '@affine/component/page-list'; import { OperationCell } from '@affine/component/page-list';
import { PageIcon } from '@blocksuite/icons'; import { PageIcon } from '@blocksuite/icons';
import { expect } from '@storybook/jest'; import { expect } from '@storybook/jest';
import type { StoryFn } from '@storybook/react'; import type { Meta, StoryFn } from '@storybook/react';
import { userEvent } from '@storybook/testing-library'; import { userEvent } from '@storybook/testing-library';
export default { export default {
@@ -16,7 +16,7 @@ export default {
parameters: { parameters: {
chromatic: { disableSnapshot: true }, chromatic: { disableSnapshot: true },
}, },
}; } satisfies Meta;
export const AffineOperationCell: StoryFn<OperationCellProps> = ({ export const AffineOperationCell: StoryFn<OperationCellProps> = ({
...props ...props

View File

@@ -12,14 +12,17 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
import { getOrCreateWorkspace } from '@affine/workspace/manager'; import { getOrCreateWorkspace } from '@affine/workspace/manager';
import type { Page } from '@blocksuite/store'; import type { Page } from '@blocksuite/store';
import { expect } from '@storybook/jest'; import { expect } from '@storybook/jest';
import type { StoryFn } from '@storybook/react'; import type { Meta, StoryFn } from '@storybook/react';
import { use } from 'foxact/use'; import { use } from 'foxact/use';
import { useState } from 'react'; import { useState } from 'react';
export default { export default {
title: 'AFFiNE/ShareMenu', title: 'AFFiNE/ShareMenu',
component: ShareMenu, component: ShareMenu,
}; parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta;
async function initPage(page: Page) { async function initPage(page: Page) {
await page.waitForLoaded(); await page.waitForLoaded();

View File

@@ -1,11 +1,14 @@
/* deepscan-disable USELESS_ARROW_FUNC_BIND */ /* deepscan-disable USELESS_ARROW_FUNC_BIND */
import { Switch } from '@affine/component'; import { Switch } from '@affine/component';
import type { StoryFn } from '@storybook/react'; import type { Meta, StoryFn } from '@storybook/react';
export default { export default {
title: 'AFFiNE/Switch', title: 'AFFiNE/Switch',
component: Switch, component: Switch,
}; parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta;
export const Basic: StoryFn = () => { export const Basic: StoryFn = () => {
return <Switch>Switch</Switch>; return <Switch>Switch</Switch>;

View File

@@ -16,6 +16,9 @@ export default {
}, },
}, },
}, },
parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta<WorkspaceAvatarProps>; } satisfies Meta<WorkspaceAvatarProps>;
const schema = new Schema(); const schema = new Schema();

View File

@@ -9,6 +9,9 @@ import { useState } from 'react';
export default { export default {
title: 'AFFiNE/WorkspaceList', title: 'AFFiNE/WorkspaceList',
component: WorkspaceList, component: WorkspaceList,
parameters: {
chromatic: { disableSnapshot: true },
},
} satisfies Meta<WorkspaceListProps>; } satisfies Meta<WorkspaceListProps>;
export const Default = () => { export const Default = () => {