mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Fix autocomplete does not work on incomplete input (#29854)
* WIP, works but need to do more testing * Update solution * Fix autocomplete with metrics * Update public/app/plugins/datasource/prometheus/language_provider.ts * Update public/app/plugins/datasource/prometheus/language_provider.ts * Change test for new functionality
This commit is contained in:
@@ -9,8 +9,9 @@ describe('parseSelector()', () => {
|
||||
expect(parsed.labelKeys).toEqual([]);
|
||||
});
|
||||
|
||||
it('throws if selector is broken', () => {
|
||||
expect(() => parseSelector('{foo')).toThrow();
|
||||
it('returns a clean selector from an unclosed selector', () => {
|
||||
const parsed = parseSelector('{foo');
|
||||
expect(parsed.selector).toBe('{}');
|
||||
});
|
||||
|
||||
it('returns the selector sorted by label key', () => {
|
||||
|
||||
Reference in New Issue
Block a user