diff --git a/src/app/features/panel/soloPanelCtrl.js b/src/app/features/panel/soloPanelCtrl.js index c7693e8f58a..d1b7b7e2cd6 100644 --- a/src/app/features/panel/soloPanelCtrl.js +++ b/src/app/features/panel/soloPanelCtrl.js @@ -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]); }); }; diff --git a/src/test/specs/soloPanelCtrl-specs.js b/src/test/specs/soloPanelCtrl-specs.js index 4908a04f99f..533f966a040 100644 --- a/src/test/specs/soloPanelCtrl-specs.js +++ b/src/test/specs/soloPanelCtrl-specs.js @@ -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();