mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cleanup and remove some jest.fn()
This commit is contained in:
parent
6670acd082
commit
e51f208a49
@ -1,6 +1,5 @@
|
|||||||
import '../datasource';
|
import '../datasource';
|
||||||
import CloudWatchDatasource from '../datasource';
|
import CloudWatchDatasource from '../datasource';
|
||||||
import 'app/features/dashboard/time_srv';
|
|
||||||
import * as dateMath from 'app/core/utils/datemath';
|
import * as dateMath from 'app/core/utils/datemath';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
@ -10,19 +9,20 @@ describe('CloudWatchDatasource', function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let templateSrv = {
|
let templateSrv = {
|
||||||
|
data: {},
|
||||||
templateSettings: { interpolate: /\[\[([\s\S]+?)\]\]/g },
|
templateSettings: { interpolate: /\[\[([\s\S]+?)\]\]/g },
|
||||||
replace: jest.fn(text => _.template(text, templateSrv.templateSettings)(templateSrv.data)),
|
replace: text => _.template(text, templateSrv.templateSettings)(templateSrv.data),
|
||||||
variableExists: jest.fn(() => false),
|
variableExists: () => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
let timeSrv = {
|
let timeSrv = {
|
||||||
time: { from: 'now-1h', to: 'now' },
|
time: { from: 'now-1h', to: 'now' },
|
||||||
timeRange: jest.fn(() => {
|
timeRange: () => {
|
||||||
return {
|
return {
|
||||||
from: dateMath.parse(timeSrv.time.from, false),
|
from: dateMath.parse(timeSrv.time.from, false),
|
||||||
to: dateMath.parse(timeSrv.time.to, true),
|
to: dateMath.parse(timeSrv.time.to, true),
|
||||||
};
|
};
|
||||||
}),
|
},
|
||||||
};
|
};
|
||||||
let backendSrv = {};
|
let backendSrv = {};
|
||||||
let ctx = <any>{
|
let ctx = <any>{
|
||||||
|
Loading…
Reference in New Issue
Block a user