mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 03:11:01 -06:00
Fixed solo panel test
This commit is contained in:
parent
c283f0996d
commit
2e0e8ba705
@ -17,8 +17,8 @@ function (angular, $) {
|
|||||||
backendSrv.getDashboard($routeParams.slug)
|
backendSrv.getDashboard($routeParams.slug)
|
||||||
.then(function(dashboard) {
|
.then(function(dashboard) {
|
||||||
$scope.initPanelScope(dashboard);
|
$scope.initPanelScope(dashboard);
|
||||||
}).then(null, function(error) {
|
}).then(null, function(err) {
|
||||||
$scope.appEvent('alert-error', ['Load panel error', error]);
|
$scope.appEvent('alert-error', ['Load panel error', err.message]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ define([
|
|||||||
|
|
||||||
describe('SoloPanelCtrl', function() {
|
describe('SoloPanelCtrl', function() {
|
||||||
var ctx = new helpers.ControllerTestContext();
|
var ctx = new helpers.ControllerTestContext();
|
||||||
var datasource = {};
|
var backendSrv = {};
|
||||||
var routeParams = {};
|
var routeParams = {};
|
||||||
var search = {};
|
var search = {};
|
||||||
|
|
||||||
@ -20,9 +20,8 @@ define([
|
|||||||
return search;
|
return search;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
datasourceSrv: {
|
templateValuesSrv: { init: sinon.stub() },
|
||||||
getGrafanaDB: sinon.stub().returns(datasource)
|
backendSrv: backendSrv
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(ctx.createControllerPhase('SoloPanelCtrl'));
|
beforeEach(ctx.createControllerPhase('SoloPanelCtrl'));
|
||||||
@ -47,7 +46,7 @@ define([
|
|||||||
|
|
||||||
routeParams.id = 1;
|
routeParams.id = 1;
|
||||||
search.panelId = 23;
|
search.panelId = 23;
|
||||||
datasource.getDashboard = sinon.stub().returns(ctx.$q.when(dashboard));
|
backendSrv.getDashboard = sinon.stub().returns(ctx.$q.when(dashboard));
|
||||||
|
|
||||||
ctx.scope.init();
|
ctx.scope.init();
|
||||||
ctx.scope.$digest();
|
ctx.scope.$digest();
|
||||||
|
Loading…
Reference in New Issue
Block a user