mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
fix tests for postgres datasource
This commit is contained in:
@ -9,12 +9,23 @@ describe('PostgreSQLDatasource', function() {
|
|||||||
let templateSrv = {
|
let templateSrv = {
|
||||||
replace: jest.fn(text => text),
|
replace: jest.fn(text => text),
|
||||||
};
|
};
|
||||||
|
const raw = {
|
||||||
|
from: moment.utc('2018-04-25 10:00'),
|
||||||
|
to: moment.utc('2018-04-25 11:00'),
|
||||||
|
};
|
||||||
let ctx = <any>{
|
let ctx = <any>{
|
||||||
backendSrv,
|
backendSrv,
|
||||||
|
timeSrvMock: {
|
||||||
|
timeRange: () => ({
|
||||||
|
from: raw.from,
|
||||||
|
to: raw.to,
|
||||||
|
raw: raw,
|
||||||
|
}),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
ctx.ds = new PostgresDatasource(instanceSettings, backendSrv, {}, templateSrv);
|
ctx.ds = new PostgresDatasource(instanceSettings, backendSrv, {}, templateSrv, ctx.timeSrvMock);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('When performing annotationQuery', function() {
|
describe('When performing annotationQuery', function() {
|
||||||
|
Reference in New Issue
Block a user