mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
11 lines
471 B
TypeScript
11 lines
471 B
TypeScript
|
import { DecoratorFn } from '@storybook/react'
|
||
|
|
||
|
/** Workaround for https://github.com/storybookjs/test-runner/issues/74 */
|
||
|
// TODO: Smoke-test all the stories by removing this decorator, once all the stories pass
|
||
|
export const withSnapshotsDisabled: DecoratorFn = (Story, { parameters }) => {
|
||
|
if (parameters?.chromatic?.disableSnapshot && navigator.userAgent.includes('StorybookTestRunner')) {
|
||
|
return <>Disabled for Test Runner</>
|
||
|
}
|
||
|
return <Story />
|
||
|
}
|