The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/dashboard/components/HelpWizard/HelpWizard.test.tsx

35 lines
1.1 KiB

import { render, screen } from '@testing-library/react';
import { FieldType, getDefaultTimeRange, LoadingState, toDataFrame } from '@grafana/data';
import { getPanelPlugin } from '@grafana/data/test';
import { PanelModel } from '../../state/PanelModel';
import { HelpWizard } from './HelpWizard';
function setup() {
const panel = new PanelModel({});
panel.plugin = getPanelPlugin({});
panel.getQueryRunner().setLastResult({
timeRange: getDefaultTimeRange(),
state: LoadingState.Done,
series: [
toDataFrame({
name: 'http_requests_total',
fields: [
{ name: 'Time', type: FieldType.time, values: [1, 2, 3] },
{ name: 'Value', type: FieldType.number, values: [11, 22, 33] },
],
}),
],
});
panel.getQueryRunner().resendLastResult();
return render(<HelpWizard panel={panel} onClose={() => {}} plugin={panel.plugin} />);
}
describe('SupportSnapshot', () => {
it('Can render', async () => {
setup();
expect(await screen.findByRole('button', { name: /Download snapshot \([\d\.]+ KiB\)/ })).toBeInTheDocument();
});
});