0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 18:07:17 +01:00
posthog/.storybook/decorators/withSnapshotsDisabled.tsx
Michael Matloka 666766429c
test(frontend): Eliminate flakiness of snapshots with charts (#14590)
* Retry pixel data check approach to canvas snapshots

* Increase canvas timeout

* Always make canvases blank

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update snapshots but only clear canvas explicitly

* Update UI snapshots for `chromium` (1)

* Revert "feat(dev): warn about recursive data structures in kea actions (#14573)"

This reverts commit 77d5cf7b08.

* Update UI snapshots

* Increase memory limit

* Don't wait between clearing canvases and taking snapshot

* Update UI snapshots for `chromium` (1)

* Try an in-app approach to chart blanking

* Update UI snapshots for `firefox` (2)

* Update UI snapshots for `webkit` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-08 18:06:32 +01:00

12 lines
484 B
TypeScript

import { DecoratorFn } from '@storybook/react'
import { inStorybookTestRunner } from 'lib/utils'
/** 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?.testOptions?.skip && inStorybookTestRunner()) {
return <>Disabled for Test Runner</>
}
return <Story />
}