diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index b974a9c117d..df66213ec06 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -230,8 +230,6 @@ function getColorForValue(data, value) { return data.colorMap[i]; } } - - console.log('first'); return _.first(data.colorMap); } diff --git a/public/app/plugins/panel/singlestat/specs/singlestat-specs.ts b/public/app/plugins/panel/singlestat/specs/singlestat-specs.ts index 8d532d17d80..4971c74ea1a 100644 --- a/public/app/plugins/panel/singlestat/specs/singlestat-specs.ts +++ b/public/app/plugins/panel/singlestat/specs/singlestat-specs.ts @@ -9,9 +9,6 @@ import angular from 'angular'; import helpers from '../../../../../test/specs/helpers'; import {SingleStatCtrl} from '../controller'; - -angular.module('grafana.controllers').controller('SingleStatCtrl', SingleStatCtrl); - describe('SingleStatCtrl', function() { var ctx = new helpers.ControllerTestContext(); @@ -25,7 +22,7 @@ describe('SingleStatCtrl', function() { beforeEach(angularMocks.module('grafana.controllers')); beforeEach(ctx.providePhase()); - beforeEach(ctx.createControllerPhase('SingleStatCtrl')); + beforeEach(ctx.createPanelController(SingleStatCtrl)); beforeEach(function() { setupFunc(); @@ -33,9 +30,9 @@ describe('SingleStatCtrl', function() { data: [{target: 'test.cpu1', datapoints: ctx.datapoints}] })); - ctx.scope.refreshData(ctx.datasource); + ctx.ctrl.refreshData(ctx.datasource); ctx.scope.$digest(); - ctx.data = ctx.scope.data; + ctx.data = ctx.ctrl.data; }); }; @@ -76,7 +73,7 @@ describe('SingleStatCtrl', function() { singleStatScenario('When value to text mapping is specified', function(ctx) { ctx.setup(function() { ctx.datapoints = [[10,1]]; - ctx.scope.panel.valueMaps = [{value: '10', text: 'OK'}]; + ctx.ctrl.panel.valueMaps = [{value: '10', text: 'OK'}]; }); it('Should replace value with text', function() {