From bdfc0d76dfa1f1f9c800fcdd92347f754130ac67 Mon Sep 17 00:00:00 2001 From: Kevin Delemme Date: Mon, 1 May 2023 11:41:59 -0400 Subject: [PATCH] fix(slo): storybook (#156261) --- .../utils/kibana_react.storybook_decorator.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx b/x-pack/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx index a0e5a1f0e037b..c79428b508ef0 100644 --- a/x-pack/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx +++ b/x-pack/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx @@ -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'; @@ -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 = { @@ -31,7 +34,6 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) { }, }, }; - const mockTheme: CoreTheme = { darkMode: false, }; @@ -86,6 +88,9 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) { addDanger: () => {}, }, }, + share: { + url: { locators: { get: () => {} } }, + }, storage: { get: () => {}, }, @@ -114,9 +119,11 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) { ObservabilityPageTemplate: KibanaPageTemplate, }} > - - - + + + + + );