2023-01-27 15:51:35 +01:00
|
|
|
import { DecoratorFn } from '@storybook/react'
|
2023-03-08 18:06:32 +01:00
|
|
|
import { inStorybookTestRunner } from 'lib/utils'
|
2023-01-27 15:51:35 +01:00
|
|
|
|
|
|
|
/** 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 }) => {
|
2023-03-08 18:06:32 +01:00
|
|
|
if (parameters?.testOptions?.skip && inStorybookTestRunner()) {
|
2023-01-27 15:51:35 +01:00
|
|
|
return <>Disabled for Test Runner</>
|
|
|
|
}
|
|
|
|
return <Story />
|
|
|
|
}
|