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/plugins/datasource/loki/components/monaco-query-field/MonacoFieldWrapper.test.tsx

34 lines
833 B

import { render, screen } from '@testing-library/react';
import React from 'react';
import { createLokiDatasource } from '../../mocks';
import { MonacoQueryFieldWrapper, Props } from './MonacoQueryFieldWrapper';
function renderComponent({
initialValue = '',
onChange = jest.fn(),
onRunQuery = jest.fn(),
runQueryOnBlur = false,
}: Partial<Props> = {}) {
const datasource = createLokiDatasource();
render(
<MonacoQueryFieldWrapper
datasource={datasource}
history={[]}
initialValue={initialValue}
onChange={onChange}
onRunQuery={onRunQuery}
runQueryOnBlur={runQueryOnBlur}
/>
);
}
describe('MonacoFieldWrapper', () => {
test('Renders with no errors', async () => {
renderComponent();
expect(await screen.findByText('Loading...')).toBeInTheDocument();
});
});