Commit 2e0e8ba7 by Torkel Ödegaard

Fixed solo panel test

parent c283f099
......@@ -17,8 +17,8 @@ function (angular, $) {
backendSrv.getDashboard($routeParams.slug)
.then(function(dashboard) {
$scope.initPanelScope(dashboard);
}).then(null, function(error) {
$scope.appEvent('alert-error', ['Load panel error', error]);
}).then(null, function(err) {
$scope.appEvent('alert-error', ['Load panel error', err.message]);
});
};
......
......@@ -7,7 +7,7 @@ define([
describe('SoloPanelCtrl', function() {
var ctx = new helpers.ControllerTestContext();
var datasource = {};
var backendSrv = {};
var routeParams = {};
var search = {};
......@@ -20,9 +20,8 @@ define([
return search;
}
},
datasourceSrv: {
getGrafanaDB: sinon.stub().returns(datasource)
}
templateValuesSrv: { init: sinon.stub() },
backendSrv: backendSrv
}));
beforeEach(ctx.createControllerPhase('SoloPanelCtrl'));
......@@ -47,7 +46,7 @@ define([
routeParams.id = 1;
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.$digest();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment