fix: fixed prometheus step issue that caused browser crash, fixes #9575

This commit is contained in:
Torkel Ödegaard
2017-10-18 13:27:55 +02:00
parent 1797e2221a
commit 8d68bd6bb9
2 changed files with 15 additions and 1 deletions

View File

@@ -294,6 +294,20 @@ describe('PrometheusDatasource', function() {
ctx.ds.query(query);
ctx.$httpBackend.verifyNoOutstandingExpectation();
});
it('step should never go below 1', function() {
var query = {
// 6 hour range
range: { from: moment(1508318768202), to: moment(1508318770118) },
targets: [{expr: 'test'}],
interval: '100ms'
};
var urlExpected = 'proxied/api/v1/query_range?query=test&start=1508318769&end=1508318771&step=1';
ctx.$httpBackend.expect('GET', urlExpected).respond(response);
ctx.ds.query(query);
ctx.$httpBackend.verifyNoOutstandingExpectation();
});
it('should be auto interval when greater than min interval', function() {
var query = {
// 6 hour range