Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
machadoum committed Jul 21, 2021
1 parent 1f31f9f commit ff91116
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface HeaderSectionProps extends HeaderProps {
tooltip?: string;
growLeftSplit?: boolean;
inspectMultiple?: boolean;
hideSubtitle?: boolean;
}

const HeaderSectionComponent: React.FC<HeaderSectionProps> = ({
Expand All @@ -64,6 +65,7 @@ const HeaderSectionComponent: React.FC<HeaderSectionProps> = ({
tooltip,
growLeftSplit = true,
inspectMultiple = false,
hideSubtitle = false,
}) => (
<Header data-test-subj="header-section" border={border} height={height}>
<EuiFlexGroup alignItems="center">
Expand All @@ -82,7 +84,9 @@ const HeaderSectionComponent: React.FC<HeaderSectionProps> = ({
</h2>
</EuiTitle>

{subtitle && <Subtitle data-test-subj="header-section-subtitle" items={subtitle} />}
{!hideSubtitle && (
<Subtitle data-test-subj="header-section-subtitle" items={subtitle} />
)}
</EuiFlexItem>

{id && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ export const AlertsCountPanel = memo<AlertsCountPanelProps>(
return (
<InspectButtonContainer>
<KpiPanel hasBorder data-test-subj="alertsCountPanel">
<HeaderSection id={uniqueQueryId} title={i18n.COUNT_TABLE_TITLE} titleSize="s">
<HeaderSection
id={uniqueQueryId}
title={i18n.COUNT_TABLE_TITLE}
titleSize="s"
hideSubtitle
>
<StackBySelect selected={selectedStackByOption} onSelect={setSelectedStackByOption} />
</HeaderSection>
<AlertsCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { AlertsHistogram } from './alerts_histogram';
import * as i18n from './translations';
import type { AlertsAggregation, AlertsTotal } from './types';
import { LinkButton } from '../../../../common/components/links';
import type { SecurityPageName } from '../../../../app/types';
import { SecurityPageName } from '../../../../app/types';
import { DEFAULT_STACK_BY_FIELD, PANEL_HEIGHT } from '../common/config';
import type { AlertsStackByField } from '../common/types';
import { KpiPanel, StackBySelect } from '../common/components';
Expand Down Expand Up @@ -261,6 +261,7 @@ export const AlertsHistogramPanel = memo<AlertsHistogramPanelProps>(
titleSize={titleSize}
subtitle={!isInitialLoading && showTotalAlertsCount && totalAlerts}
isInspectDisabled={isInspectDisabled}
hideSubtitle
>
<EuiFlexGroup alignItems="center" gutterSize="none">
<EuiFlexItem grow={false}>
Expand Down

0 comments on commit ff91116

Please sign in to comment.