fix: query ctrl unit tests now pass as before

This commit is contained in:
Torkel Ödegaard 2017-09-08 13:52:28 +02:00
parent 2953d64429
commit 75c4c4d8b5
3 changed files with 16 additions and 3 deletions

View File

@ -24,6 +24,11 @@ describe('GraphiteQueryCtrl', function() {
ctx.target = {target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)'};
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
ctx.panelCtrl = {panel: {}};
ctx.panelCtrl = {
panel: {
targets: [ctx.target]
}
};
ctx.panelCtrl.refresh = sinon.spy();
ctx.ctrl = $controller(GraphiteQueryCtrl, {$scope: ctx.scope}, {

View File

@ -19,9 +19,13 @@ describe('InfluxDBQueryCtrl', function() {
ctx.$q = $q;
ctx.scope = $rootScope.$new();
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
ctx.panelCtrl = {panel: {}};
ctx.panelCtrl.refresh = sinon.spy();
ctx.target = {target: {}};
ctx.panelCtrl = {
panel: {
targets: [ctx.target]
}
};
ctx.panelCtrl.refresh = sinon.spy();
ctx.ctrl = $controller(InfluxQueryCtrl, {$scope: ctx.scope}, {
panelCtrl: ctx.panelCtrl,
target: ctx.target,

View File

@ -18,7 +18,11 @@ describe('OpenTsQueryCtrl', function() {
ctx.$q = $q;
ctx.scope = $rootScope.$new();
ctx.target = {target: ''};
ctx.panelCtrl = {panel: {}};
ctx.panelCtrl = {
panel: {
targets: [ctx.target]
}
};
ctx.panelCtrl.refresh = sinon.spy();
ctx.datasource.getAggregators = sinon.stub().returns(ctx.$q.when([]));
ctx.datasource.getFilterTypes = sinon.stub().returns(ctx.$q.when([]));