Skip to content

Commit

Permalink
Use our own new platform mock for storybook (#12)
Browse files Browse the repository at this point in the history
Use our own new platform mock for storybook
  • Loading branch information
clintandrewhall authored Dec 11, 2019
2 parents 8508f81 + 1d397ba commit 94893ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions x-pack/legacy/plugins/canvas/.storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { withKnobs } from '@storybook/addon-knobs/react';
import { withInfo } from '@storybook/addon-info';
import { create } from '@storybook/theming';

import { coreMock } from 'src/core/public/mocks';
import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public';

// If we're running Storyshots, be sure to register the require context hook.
Expand Down Expand Up @@ -38,9 +37,12 @@ if (process.env.NODE_ENV === 'test') {
}

// Add New Platform Context for any stories that need it
addDecorator(fn => (
<KibanaContextProvider services={coreMock.createStart()}>{fn()}</KibanaContextProvider>
));
const settings = new Map();
settings.set('darkMode', true);
const platform = {
uiSettings: settings,
};
addDecorator(fn => <KibanaContextProvider services={platform}>{fn()}</KibanaContextProvider>);

function loadStories() {
require('./dll_contexts');
Expand Down

0 comments on commit 94893ca

Please sign in to comment.