|
|
@@ -1,25 +1,26 @@
|
|
|
-import { describe, beforeEach, it, expect, angularMocks } from '../../../../../test/lib/common';
|
|
|
-
|
|
|
import moment from 'moment';
|
|
|
import { HeatmapCtrl } from '../heatmap_ctrl';
|
|
|
-import helpers from '../../../../../test/specs/helpers';
|
|
|
|
|
|
describe('HeatmapCtrl', function() {
|
|
|
- var ctx = new helpers.ControllerTestContext();
|
|
|
+ let ctx = <any>{};
|
|
|
+
|
|
|
+ let $injector = {
|
|
|
+ get: () => {},
|
|
|
+ };
|
|
|
+
|
|
|
+ let $scope = {
|
|
|
+ $on: () => {},
|
|
|
+ };
|
|
|
|
|
|
- beforeEach(angularMocks.module('grafana.services'));
|
|
|
- beforeEach(angularMocks.module('grafana.controllers'));
|
|
|
- beforeEach(
|
|
|
- angularMocks.module(function($compileProvider) {
|
|
|
- $compileProvider.preAssignBindingsEnabled(true);
|
|
|
- })
|
|
|
- );
|
|
|
+ HeatmapCtrl.prototype.panel = {
|
|
|
+ events: {
|
|
|
+ on: () => {},
|
|
|
+ emit: () => {},
|
|
|
+ },
|
|
|
+ };
|
|
|
|
|
|
- beforeEach(ctx.providePhase());
|
|
|
- beforeEach(ctx.createPanelController(HeatmapCtrl));
|
|
|
beforeEach(() => {
|
|
|
- ctx.ctrl.annotationsPromise = Promise.resolve({});
|
|
|
- ctx.ctrl.updateTimeRange();
|
|
|
+ ctx.ctrl = new HeatmapCtrl($scope, $injector, {});
|
|
|
});
|
|
|
|
|
|
describe('when time series are outside range', function() {
|
|
|
@@ -36,7 +37,7 @@ describe('HeatmapCtrl', function() {
|
|
|
});
|
|
|
|
|
|
it('should set datapointsOutside', function() {
|
|
|
- expect(ctx.ctrl.dataWarning.title).to.be('Data points outside time range');
|
|
|
+ expect(ctx.ctrl.dataWarning.title).toBe('Data points outside time range');
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -61,7 +62,7 @@ describe('HeatmapCtrl', function() {
|
|
|
});
|
|
|
|
|
|
it('should set datapointsOutside', function() {
|
|
|
- expect(ctx.ctrl.dataWarning).to.be(null);
|
|
|
+ expect(ctx.ctrl.dataWarning).toBe(null);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
@@ -72,7 +73,7 @@ describe('HeatmapCtrl', function() {
|
|
|
});
|
|
|
|
|
|
it('should set datapointsCount warning', function() {
|
|
|
- expect(ctx.ctrl.dataWarning.title).to.be('No data points');
|
|
|
+ expect(ctx.ctrl.dataWarning.title).toBe('No data points');
|
|
|
});
|
|
|
});
|
|
|
});
|