mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 03:03:57 +08:00
22 lines
677 B
TypeScript
22 lines
677 B
TypeScript
import React from 'react';
|
|
import { render, screen } from '@testing-library/react';
|
|
import { Stats } from './Stats';
|
|
|
|
const toOption = (value: any) => ({ label: value, value });
|
|
|
|
describe('Stats', () => {
|
|
it('should render component', () => {
|
|
render(
|
|
<Stats
|
|
data-testid="stats"
|
|
values={['Average', 'Minimum']}
|
|
variableOptionGroup={{ label: 'templateVar', value: 'templateVar' }}
|
|
onChange={() => {}}
|
|
stats={['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount'].map(toOption)}
|
|
/>
|
|
);
|
|
expect(screen.getByText('Average')).toBeInTheDocument();
|
|
expect(screen.getByText('Minimum')).toBeInTheDocument();
|
|
});
|
|
});
|