Fix karma tests that rely on MetricsPanelCtrl

This commit is contained in:
David Kaltschmidt 2018-05-30 15:24:47 +02:00
parent 7224ca6c62
commit 827fb7e8de
2 changed files with 4 additions and 2 deletions

View File

@ -1,9 +1,9 @@
import config from 'app/core/config';
import $ from 'jquery';
import _ from 'lodash';
import config from 'app/core/config';
import kbn from 'app/core/utils/kbn';
import { PanelCtrl } from 'app/features/panel/panel_ctrl';
import * as rangeUtil from 'app/core/utils/rangeutil';
import * as dateMath from 'app/core/utils/datemath';
import { encodePathComponent } from 'app/core/utils/location_util';

View File

@ -11,6 +11,7 @@ export function ControllerTestContext() {
this.$element = {};
this.$sanitize = {};
this.annotationsSrv = {};
this.contextSrv = {};
this.timeSrv = new TimeSrvStub();
this.templateSrv = new TemplateSrvStub();
this.datasourceSrv = {
@ -27,6 +28,7 @@ export function ControllerTestContext() {
this.providePhase = function(mocks) {
return angularMocks.module(function($provide) {
$provide.value('contextSrv', self.contextSrv);
$provide.value('datasourceSrv', self.datasourceSrv);
$provide.value('annotationsSrv', self.annotationsSrv);
$provide.value('timeSrv', self.timeSrv);