2023-10-26 13:27:17 +02:00
|
|
|
import { Decorator } 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
|
2023-10-26 13:27:17 +02:00
|
|
|
export const withSnapshotsDisabled: Decorator = (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 />
|
|
|
|
}
|