Torkel Ödegaard пре 11 година
родитељ
комит
7ad18da08e
1 измењених фајлова са 8 додато и 3 уклоњено
  1. 8 3
      src/test/specs/helpers.js

+ 8 - 3
src/test/specs/helpers.js

@@ -1,6 +1,6 @@
 define([
 define([
-    'kbn',
-    'lodash'
+ 'kbn',
+ 'lodash'
 ], function(kbn, _) {
 ], function(kbn, _) {
   'use strict';
   'use strict';
 
 
@@ -24,7 +24,7 @@ define([
         $provide.value('timeSrv', self.timeSrv);
         $provide.value('timeSrv', self.timeSrv);
         $provide.value('templateSrv', self.templateSrv);
         $provide.value('templateSrv', self.templateSrv);
         $provide.value('$element', self.$element);
         $provide.value('$element', self.$element);
-        _.each(mocks, function(key, value) {
+        _.each(mocks, function(value, key) {
           $provide.value(key, value);
           $provide.value(key, value);
         });
         });
       });
       });
@@ -34,16 +34,20 @@ define([
       return inject(function($controller, $rootScope, $q, $location) {
       return inject(function($controller, $rootScope, $q, $location) {
         self.scope = $rootScope.$new();
         self.scope = $rootScope.$new();
         self.$location = $location;
         self.$location = $location;
+        self.scope.grafana = {};
         self.scope.panel = {};
         self.scope.panel = {};
         self.scope.row = { panels:[] };
         self.scope.row = { panels:[] };
         self.scope.dashboard = {};
         self.scope.dashboard = {};
         self.scope.dashboardViewState = new DashboardViewStateStub();
         self.scope.dashboardViewState = new DashboardViewStateStub();
+        self.scope.appEvent = sinon.spy();
+        self.scope.onAppEvent = sinon.spy();
 
 
         $rootScope.colors = [];
         $rootScope.colors = [];
         for (var i = 0; i < 50; i++) { $rootScope.colors.push('#' + i); }
         for (var i = 0; i < 50; i++) { $rootScope.colors.push('#' + i); }
 
 
         self.$q = $q;
         self.$q = $q;
         self.scope.skipDataOnInit = true;
         self.scope.skipDataOnInit = true;
+        self.scope.skipAutoInit = true;
         self.controller = $controller(controllerName, {
         self.controller = $controller(controllerName, {
           $scope: self.scope
           $scope: self.scope
         });
         });
@@ -87,6 +91,7 @@ define([
   }
   }
 
 
   function TimeSrvStub() {
   function TimeSrvStub() {
+    this.init = sinon.spy();
     this.time = { from:'now-1h', to: 'now'};
     this.time = { from:'now-1h', to: 'now'};
     this.timeRange = function(parse) {
     this.timeRange = function(parse) {
       if (parse === false) {
       if (parse === false) {