Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashokaditya committed Nov 6, 2024
1 parent c547619 commit 486ad91
Show file tree
Hide file tree
Showing 7 changed files with 590 additions and 188 deletions.
7 changes: 5 additions & 2 deletions x-pack/plugins/data_usage/public/app/components/charts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ import { EuiFlexGroup } from '@elastic/eui';
import { MetricTypes } from '../../../common/rest_types';
import { ChartPanel } from './chart_panel';
import { UsageMetricsResponseSchemaBody } from '../../../common/rest_types';
import { useTestIdGenerator } from '../../hooks/use_test_id_generator';
interface ChartsProps {
data: UsageMetricsResponseSchemaBody;
'data-test-subj'?: string;
}

export const Charts: React.FC<ChartsProps> = ({ data }) => {
export const Charts: React.FC<ChartsProps> = ({ data, 'data-test-subj': dataTestSubj }) => {
const getTestId = useTestIdGenerator(dataTestSubj);
const [popoverOpen, setPopoverOpen] = useState<string | null>(null);
const togglePopover = useCallback((streamName: string | null) => {
setPopoverOpen((prev) => (prev === streamName ? null : streamName));
}, []);

return (
<EuiFlexGroup direction="column">
<EuiFlexGroup direction="column" data-test-subj={getTestId('charts')}>
{Object.entries(data.metrics).map(([metricType, series], idx) => (
<ChartPanel
key={metricType}
Expand Down
Loading

0 comments on commit 486ad91

Please sign in to comment.