diff --git a/lib/ui/src/components/layout/layout.stories.js b/lib/ui/src/components/layout/layout.stories.js index 453ce8644f3..2731c23d3d5 100644 --- a/lib/ui/src/components/layout/layout.stories.js +++ b/lib/ui/src/components/layout/layout.stories.js @@ -5,6 +5,8 @@ import { storiesOf } from '@storybook/react'; import { withKnobs, boolean, number } from '@storybook/addon-knobs'; import { styled } from '@storybook/theming'; +import { isChromatic } from 'storybook-chromatic/isChromatic'; + import { Desktop } from './desktop'; import { Mobile } from './mobile'; @@ -16,6 +18,7 @@ import { panels } from '../panel/panel.stories'; import { previewProps } from '../preview/preview.stories'; import { mockDataset } from '../sidebar/treeview/treeview.mockdata'; +import { store } from './persist'; const realNavProps = { title: 'Title', @@ -145,8 +148,12 @@ storiesOf('UI|Layout/Desktop', module) .addDecorator(withKnobs) .addDecorator(storyFn => { const mocked = boolean('mock', true); - const height = number('height', window.innerHeight); - const width = number('width', window.innerWidth); + const height = number('height', 1200); + const width = number('width', 1200); + + if (isChromatic) { + store.local.set(`storybook-layout`, {}); + } const props = { height, @@ -154,7 +161,7 @@ storiesOf('UI|Layout/Desktop', module) ...(mocked ? mockProps : realProps), }; - return