prometheus: enable new monaco-based query field (#41357)

* prometheus: enable new monaco-based query field

* updated test

* updated tests

* fix e2e tests

* updated comment
This commit is contained in:
Gábor Farkas
2021-11-08 14:20:48 +01:00
committed by GitHub
parent e31bd2df2f
commit 9d82111a1a
10 changed files with 57 additions and 35 deletions

View File

@@ -6,6 +6,16 @@ import { PrometheusDatasource } from '../datasource';
import { PromQuery } from '../types';
import { LoadingState, PanelData, toUtc, TimeRange } from '@grafana/data';
// the monaco-based editor uses lazy-loading and that does not work
// well with this test, and we do not need the monaco-related
// functionality in this test anyway, so we mock it out.
jest.mock('./monaco-query-field/MonacoQueryFieldWrapper', () => {
const fakeQueryField = () => <div>prometheus query field</div>;
return {
MonacoQueryFieldWrapper: fakeQueryField,
};
});
const setup = (renderMethod: any, propOverrides?: object) => {
const datasourceMock: unknown = {
languageProvider: {