mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 11:43:13 +08:00
Loki,Prometheus: Fix of showing error message for empty query (#47379)
* Loki,Prometheus: Dont show error on empty query * Add tests
This commit is contained in:
@ -2,6 +2,15 @@ import { buildVisualQueryFromString } from './parsing';
|
||||
import { LokiVisualQuery } from './types';
|
||||
|
||||
describe('buildVisualQueryFromString', () => {
|
||||
it('creates no errors for empty query', () => {
|
||||
expect(buildVisualQueryFromString('')).toEqual(
|
||||
noErrors({
|
||||
labels: [],
|
||||
operations: [],
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('parses simple query with label-values', () => {
|
||||
expect(buildVisualQueryFromString('{app="frontend"}')).toEqual(
|
||||
noErrors({
|
||||
|
Reference in New Issue
Block a user