Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Dec 21, 2022
1 parent 73424d7 commit 5fc4ece
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -121,6 +122,9 @@ const defaultProps: Props = {
stackByField0: 'kibana.alert.rule.name',
stackByField1: 'host.name',
title: <ChartSelect alertViewSelection="treemap" setAlertViewSelection={jest.fn()} />,
showBuildingBlockAlerts: false,
status: 'open' as Status,
showOnlyThreatIndicatorAlerts: false,
};

describe('AlertsTreemapPanel', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface UseInspectButtonParams extends Pick<GlobalTimeArgs, 'setQuery'
refetch: (() => void) | null;
uniqueQueryId: string;
loading: boolean;
searchSessionId: string;
searchSessionId?: string;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 5fc4ece

Please sign in to comment.