diff --git a/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx deleted file mode 100644 index dc60887b68d6..000000000000 --- a/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import { InfoSummary } from './MetricsChartTooltip'; - -test('Renders apps, flags, and environments, even when their data is `N/A`', () => { - render( - , - ); - - screen.getByText('Environments'); - screen.getByText('Apps'); - screen.getByText('Flags'); -}); diff --git a/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx index 6cd3c5b48e41..9054c162ff56 100644 --- a/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx +++ b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx @@ -2,6 +2,7 @@ import type { VFC } from 'react'; import type { InstanceInsightsSchemaMetricsSummaryTrendsItem } from 'openapi'; import { Box, Divider, Paper, styled, Typography } from '@mui/material'; import type { TooltipState } from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip'; +import { ConditionallyRender } from '../../../../common/ConditionallyRender/ConditionallyRender'; const StyledTooltipItemContainer = styled(Paper)(({ theme }) => ({ padding: theme.spacing(2), @@ -126,24 +127,38 @@ export const MetricsSummaryTooltip: VFC<{ tooltip: TooltipState | null }> = ({ title={`Not exposed: ${point.value.totalNo ?? 0}`} color={'error'} /> - ({ margin: theme.spacing(1.5, 0) })} - /> - + ({ + margin: theme.spacing(1.5, 0), + })} + /> + + + } /> )) || null}