mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix: query ctrl unit tests now pass as before
This commit is contained in:
parent
2953d64429
commit
75c4c4d8b5
@ -24,6 +24,11 @@ describe('GraphiteQueryCtrl', function() {
|
|||||||
ctx.target = {target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)'};
|
ctx.target = {target: 'aliasByNode(scaleToSeconds(test.prod.*,1),2)'};
|
||||||
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
|
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
|
||||||
ctx.panelCtrl = {panel: {}};
|
ctx.panelCtrl = {panel: {}};
|
||||||
|
ctx.panelCtrl = {
|
||||||
|
panel: {
|
||||||
|
targets: [ctx.target]
|
||||||
|
}
|
||||||
|
};
|
||||||
ctx.panelCtrl.refresh = sinon.spy();
|
ctx.panelCtrl.refresh = sinon.spy();
|
||||||
|
|
||||||
ctx.ctrl = $controller(GraphiteQueryCtrl, {$scope: ctx.scope}, {
|
ctx.ctrl = $controller(GraphiteQueryCtrl, {$scope: ctx.scope}, {
|
||||||
|
@ -19,9 +19,13 @@ describe('InfluxDBQueryCtrl', function() {
|
|||||||
ctx.$q = $q;
|
ctx.$q = $q;
|
||||||
ctx.scope = $rootScope.$new();
|
ctx.scope = $rootScope.$new();
|
||||||
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
|
ctx.datasource.metricFindQuery = sinon.stub().returns(ctx.$q.when([]));
|
||||||
ctx.panelCtrl = {panel: {}};
|
|
||||||
ctx.panelCtrl.refresh = sinon.spy();
|
|
||||||
ctx.target = {target: {}};
|
ctx.target = {target: {}};
|
||||||
|
ctx.panelCtrl = {
|
||||||
|
panel: {
|
||||||
|
targets: [ctx.target]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ctx.panelCtrl.refresh = sinon.spy();
|
||||||
ctx.ctrl = $controller(InfluxQueryCtrl, {$scope: ctx.scope}, {
|
ctx.ctrl = $controller(InfluxQueryCtrl, {$scope: ctx.scope}, {
|
||||||
panelCtrl: ctx.panelCtrl,
|
panelCtrl: ctx.panelCtrl,
|
||||||
target: ctx.target,
|
target: ctx.target,
|
||||||
|
@ -18,7 +18,11 @@ describe('OpenTsQueryCtrl', function() {
|
|||||||
ctx.$q = $q;
|
ctx.$q = $q;
|
||||||
ctx.scope = $rootScope.$new();
|
ctx.scope = $rootScope.$new();
|
||||||
ctx.target = {target: ''};
|
ctx.target = {target: ''};
|
||||||
ctx.panelCtrl = {panel: {}};
|
ctx.panelCtrl = {
|
||||||
|
panel: {
|
||||||
|
targets: [ctx.target]
|
||||||
|
}
|
||||||
|
};
|
||||||
ctx.panelCtrl.refresh = sinon.spy();
|
ctx.panelCtrl.refresh = sinon.spy();
|
||||||
ctx.datasource.getAggregators = sinon.stub().returns(ctx.$q.when([]));
|
ctx.datasource.getAggregators = sinon.stub().returns(ctx.$q.when([]));
|
||||||
ctx.datasource.getFilterTypes = sinon.stub().returns(ctx.$q.when([]));
|
ctx.datasource.getFilterTypes = sinon.stub().returns(ctx.$q.when([]));
|
||||||
|
Loading…
Reference in New Issue
Block a user