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