mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Small fix to graphiteDatasource and sending cacheTimeout undefined, reintroduced this bug yesterday, added unit test so it should not appear again
This commit is contained in:
parent
917cd35005
commit
65af872ec6
@ -251,7 +251,9 @@ function (angular, _, $, config, kbn, moment) {
|
|||||||
|
|
||||||
_.each(options, function (value, key) {
|
_.each(options, function (value, key) {
|
||||||
if ($.inArray(key, graphite_options) === -1) { return; }
|
if ($.inArray(key, graphite_options) === -1) { return; }
|
||||||
|
if (value) {
|
||||||
clean_options.push(key + "=" + encodeURIComponent(value));
|
clean_options.push(key + "=" + encodeURIComponent(value));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return clean_options;
|
return clean_options;
|
||||||
|
@ -18,7 +18,7 @@ define([
|
|||||||
var query = {
|
var query = {
|
||||||
range: { from: 'now-1h', to: 'now' },
|
range: { from: 'now-1h', to: 'now' },
|
||||||
targets: [{ target: 'prod1.count' }, {target: 'prod2.count'}],
|
targets: [{ target: 'prod1.count' }, {target: 'prod2.count'}],
|
||||||
maxDataPoints: 500
|
maxDataPoints: 500,
|
||||||
};
|
};
|
||||||
|
|
||||||
var response = [{ target: 'prod1.count', points: [[10, 1], [12,1]], }];
|
var response = [{ target: 'prod1.count', points: [[10, 1], [12,1]], }];
|
||||||
@ -46,6 +46,11 @@ define([
|
|||||||
expect(params).to.contain('until=now');
|
expect(params).to.contain('until=now');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should exclude undefined params', function() {
|
||||||
|
var params = request.split('&');
|
||||||
|
expect(params).to.not.contain('cacheTimeout=undefined');
|
||||||
|
});
|
||||||
|
|
||||||
it('should return series list', function() {
|
it('should return series list', function() {
|
||||||
expect(results.data.length).to.be(1);
|
expect(results.data.length).to.be(1);
|
||||||
expect(results.data[0].target).to.be('prod1.count');
|
expect(results.data[0].target).to.be('prod1.count');
|
||||||
|
Loading…
Reference in New Issue
Block a user