feat(panels): fixed singlestat tests

This commit is contained in:
Torkel Ödegaard
2016-01-27 19:16:33 -05:00
parent 97ac81aa9c
commit 307c86fc28
2 changed files with 4 additions and 9 deletions

View File

@@ -230,8 +230,6 @@ function getColorForValue(data, value) {
return data.colorMap[i];
}
}
console.log('first');
return _.first(data.colorMap);
}

View File

@@ -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() {