mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Slight refactoring, #1525
This commit is contained in:
@@ -62,6 +62,34 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
describe('when building tag keys query', function() {
|
||||
|
||||
describe('given picked measurement', function() {
|
||||
it('build query with measurement filter', function() {
|
||||
var builder = new InfluxQueryBuilder({ measurement: 'cpu', tags: [] });
|
||||
var query = builder.showTagsQuery();
|
||||
expect(query).to.be('SHOW TAG KEYS FROM "cpu"');
|
||||
});
|
||||
});
|
||||
|
||||
describe('given no picked measurement', function() {
|
||||
it('build query without filter', function() {
|
||||
var builder = new InfluxQueryBuilder({ measurement: '', tags: [] });
|
||||
var query = builder.showTagsQuery();
|
||||
expect(query).to.be('SHOW TAG KEYS');
|
||||
});
|
||||
});
|
||||
|
||||
describe('given an existing tag', function() {
|
||||
it('build query with filter', function() {
|
||||
var builder = new InfluxQueryBuilder({ measurement: '', tags: [{key: 'host', value: 'se1'}] });
|
||||
var query = builder.showTagsQuery();
|
||||
expect(query).to.be('SHOW TAG KEYS');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -198,23 +198,6 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
describe('when building tag keys query', function() {
|
||||
|
||||
describe('given picked measurement', function() {
|
||||
it('build query with measurement filter', function() {
|
||||
var query = ctx.scope.buildTagKeysQuery({ measurement: 'cpu', tags: [] }, {type: 'key'});
|
||||
expect(query).to.be('SHOW TAG KEYS FROM "cpu"');
|
||||
});
|
||||
});
|
||||
|
||||
describe('given no picked measurement', function() {
|
||||
it('build query without filter', function() {
|
||||
var query = ctx.scope.buildTagKeysQuery({ measurement: '', tags: [] }, {type: 'key'});
|
||||
expect(query).to.be('SHOW TAG KEYS');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user