mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix prometheus annotation, reflect API change
This commit is contained in:
@@ -162,11 +162,17 @@ describe('PrometheusDatasource', function() {
|
||||
var urlExpected = 'proxied/api/v1/query_range?query=' +
|
||||
encodeURIComponent('ALERTS{alertstate="firing"}') +
|
||||
'&start=1443438675&end=1443460275&step=60s';
|
||||
var annotation = {
|
||||
expr: 'ALERTS{alertstate="firing"}',
|
||||
tagKeys: 'job',
|
||||
titleFormat: '{{alertname}}',
|
||||
textFormat: '{{instance}}'
|
||||
var options = {
|
||||
annotation: {
|
||||
expr: 'ALERTS{alertstate="firing"}',
|
||||
tagKeys: 'job',
|
||||
titleFormat: '{{alertname}}',
|
||||
textFormat: '{{instance}}'
|
||||
},
|
||||
range: {
|
||||
from: moment(1443438674760),
|
||||
to: moment(1443460274760)
|
||||
}
|
||||
};
|
||||
var response = {
|
||||
status: "success",
|
||||
@@ -180,7 +186,7 @@ describe('PrometheusDatasource', function() {
|
||||
};
|
||||
beforeEach(function() {
|
||||
ctx.$httpBackend.expect('GET', urlExpected).respond(response);
|
||||
ctx.ds.annotationQuery(annotation, {from: moment(1443438674760), to: moment(1443460274760)}).then(function(data) { results = data; });
|
||||
ctx.ds.annotationQuery(options).then(function(data) { results = data; });
|
||||
ctx.$httpBackend.flush();
|
||||
});
|
||||
it('should return annotation list', function() {
|
||||
|
||||
Reference in New Issue
Block a user