|
|
@@ -667,6 +667,19 @@ describe('PrometheusDatasource', () => {
|
|
|
},
|
|
|
};
|
|
|
|
|
|
+ describe('when time series query is cancelled', () => {
|
|
|
+ it('should return empty results', async () => {
|
|
|
+ backendSrv.datasourceRequest = jest.fn(() => Promise.resolve({ cancelled: true }));
|
|
|
+ ctx.ds = new PrometheusDatasource(instanceSettings, q, backendSrv as any, templateSrv as any, timeSrv as any);
|
|
|
+
|
|
|
+ await ctx.ds.annotationQuery(options).then((data: any) => {
|
|
|
+ results = data;
|
|
|
+ });
|
|
|
+
|
|
|
+ expect(results).toEqual([]);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
describe('not use useValueForTime', () => {
|
|
|
beforeEach(async () => {
|
|
|
options.annotation.useValueForTime = false;
|