From 5fc4eceee7a707efd3b73b687dd6ed11a5001506 Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Wed, 21 Dec 2022 17:36:39 +0000 Subject: [PATCH] fix types --- .../common/components/alerts_treemap_panel/index.test.tsx | 4 ++++ .../components/alerts_kpis/alerts_count_panel/index.test.tsx | 5 +++++ .../public/detections/components/alerts_kpis/common/hooks.ts | 2 +- .../pages/detection_engine/chart_panels/index.test.tsx | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/common/components/alerts_treemap_panel/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/alerts_treemap_panel/index.test.tsx index 0db21ee27ea75d..9c7d731bec5a0b 100644 --- a/x-pack/plugins/security_solution/public/common/components/alerts_treemap_panel/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/alerts_treemap_panel/index.test.tsx @@ -9,6 +9,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import React from 'react'; import { useLocation } from 'react-router-dom'; +import type { Status } from '../../../../common/detection_engine/schemas/common'; import { SecurityPageName } from '../../../../common/constants'; import { useGlobalTime } from '../../containers/use_global_time'; import { @@ -121,6 +122,9 @@ const defaultProps: Props = { stackByField0: 'kibana.alert.rule.name', stackByField1: 'host.name', title: , + showBuildingBlockAlerts: false, + status: 'open' as Status, + showOnlyThreatIndicatorAlerts: false, }; describe('AlertsTreemapPanel', () => { diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx index fc752b243f9b1c..536e5a77649113 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx @@ -10,6 +10,8 @@ import { waitFor, act } from '@testing-library/react'; import { mount } from 'enzyme'; import { AlertsCountPanel } from '.'; + +import type { Status } from '../../../../../common/detection_engine/schemas/common'; import { useQueryToggle } from '../../../../common/containers/query_toggle'; import { useGlobalTime } from '../../../../common/containers/use_global_time'; import { DEFAULT_STACK_BY_FIELD, DEFAULT_STACK_BY_FIELD1 } from '../common/config'; @@ -58,6 +60,9 @@ describe('AlertsCountPanel', () => { stackByField1: DEFAULT_STACK_BY_FIELD1, setStackByField0: jest.fn(), setStackByField1: jest.fn(), + showBuildingBlockAlerts: false, + showOnlyThreatIndicatorAlerts: false, + status: 'open' as Status, }; const mockSetToggle = jest.fn(); const mockUseQueryToggle = useQueryToggle as jest.Mock; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts index b5daf49cdd9904..079b69b76e4885 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts @@ -19,7 +19,7 @@ export interface UseInspectButtonParams extends Pick void) | null; uniqueQueryId: string; loading: boolean; - searchSessionId: string; + searchSessionId?: string; } /** diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx index 4cef9f95dcc6e8..127ebb95a0ba5e 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx @@ -9,6 +9,7 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import React from 'react'; import { useAlertsLocalStorage } from './alerts_local_storage'; +import type { Status } from '../../../../../common/detection_engine/schemas/common'; import { RESET_GROUP_BY_FIELDS } from '../../../../common/components/chart_settings_popover/configurations/default/translations'; import { CHART_SETTINGS_POPOVER_ARIA_LABEL } from '../../../../common/components/chart_settings_popover/translations'; import { mockBrowserFields } from '../../../../common/containers/source/mock'; @@ -112,6 +113,9 @@ const defaultProps = { runtimeMappings: {}, signalIndexName: '.alerts-security.alerts-default', updateDateRangeCallback: jest.fn(), + showBuildingBlockAlerts: false, + filterGroup: 'open' as Status, + showOnlyThreatIndicatorAlerts: false, }; const resetGroupByFields = () => {