Skip to content

Commit

Permalink
fix(slo): storybook (#156261)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored May 1, 2023
1 parent d22825a commit bdfc0d7
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { AppMountParameters } from '@kbn/core-application-browser';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import { CoreTheme } from '@kbn/core-theme-browser';
import { MemoryRouter } from 'react-router-dom';
import { casesFeatureId, sloFeatureId } from '../../common';
import { PluginContext } from '../context/plugin_context';
import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock';
Expand All @@ -19,7 +20,9 @@ import { ConfigSchema } from '../plugin';
export function KibanaReactStorybookDecorator(Story: ComponentType) {
const queryClient = new QueryClient();

const appMountParameters = { setHeaderActionMenu: () => {} } as unknown as AppMountParameters;
const appMountParameters = {
setHeaderActionMenu: () => {},
} as unknown as AppMountParameters;
const observabilityRuleTypeRegistry = createObservabilityRuleTypeRegistryMock();

const config: ConfigSchema = {
Expand All @@ -31,7 +34,6 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
},
},
};

const mockTheme: CoreTheme = {
darkMode: false,
};
Expand Down Expand Up @@ -86,6 +88,9 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
addDanger: () => {},
},
},
share: {
url: { locators: { get: () => {} } },
},
storage: {
get: () => {},
},
Expand Down Expand Up @@ -114,9 +119,11 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) {
ObservabilityPageTemplate: KibanaPageTemplate,
}}
>
<QueryClientProvider client={queryClient}>
<Story />
</QueryClientProvider>
<MemoryRouter>
<QueryClientProvider client={queryClient}>
<Story />
</QueryClientProvider>
</MemoryRouter>
</PluginContext.Provider>
</KibanaContextProvider>
);
Expand Down

0 comments on commit bdfc0d7

Please sign in to comment.