diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap index cc8395455d89..535c883aed53 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/__snapshots__/geo_containment_alert_type_expression.test.tsx.snap @@ -16,13 +16,23 @@ exports[`should render BoundaryIndexExpression 1`] = ` labelType="label" > @@ -82,13 +92,23 @@ exports[`should render EntityIndexExpression 1`] = ` labelType="label" > @@ -154,13 +174,23 @@ exports[`should render EntityIndexExpression w/ invalid flag if invalid 1`] = ` labelType="label" > diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx index c35427bc6bc0..0c5f121943e0 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/geo_containment_alert_type_expression.test.tsx @@ -8,22 +8,11 @@ import React from 'react'; import { shallow } from 'enzyme'; import { EntityIndexExpression } from './expressions/entity_index_expression'; import { BoundaryIndexExpression } from './expressions/boundary_index_expression'; -import { ApplicationStart, DocLinksStart, HttpSetup, ToastsStart } from 'kibana/public'; -import { - ActionTypeRegistryContract, - AlertTypeRegistryContract, - IErrorObject, -} from '../../../../../triggers_actions_ui/public'; +import { IErrorObject } from '../../../../../triggers_actions_ui/public'; import { IIndexPattern } from '../../../../../../../src/plugins/data/common'; +import { dataPluginMock } from 'src/plugins/data/public/mocks'; -const alertsContext = { - http: (null as unknown) as HttpSetup, - alertTypeRegistry: (null as unknown) as AlertTypeRegistryContract, - actionTypeRegistry: (null as unknown) as ActionTypeRegistryContract, - toastNotifications: (null as unknown) as ToastsStart, - docLinks: (null as unknown) as DocLinksStart, - capabilities: (null as unknown) as ApplicationStart['capabilities'], -}; +const dataStartMock = dataPluginMock.createStartContract(); const alertParams = { index: '', @@ -42,7 +31,6 @@ test('should render EntityIndexExpression', async () => { {}} setAlertParamsGeoField={() => {}} @@ -50,6 +38,7 @@ test('should render EntityIndexExpression', async () => { setIndexPattern={() => {}} indexPattern={('' as unknown) as IIndexPattern} isInvalid={false} + data={dataStartMock} /> ); @@ -61,7 +50,6 @@ test('should render EntityIndexExpression w/ invalid flag if invalid', async () {}} setAlertParamsGeoField={() => {}} @@ -69,6 +57,7 @@ test('should render EntityIndexExpression w/ invalid flag if invalid', async () setIndexPattern={() => {}} indexPattern={('' as unknown) as IIndexPattern} isInvalid={true} + data={dataStartMock} /> ); @@ -79,13 +68,13 @@ test('should render BoundaryIndexExpression', async () => { const component = shallow( {}} setBoundaryGeoField={() => {}} setBoundaryNameField={() => {}} boundaryNameField={'testNameField'} + data={dataStartMock} /> );