From 7ad18da08e58b693e6dc2583cfeea1ceeeb28310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 1 Oct 2014 13:49:36 +0200 Subject: [PATCH] update to test helper --- src/test/specs/helpers.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/test/specs/helpers.js b/src/test/specs/helpers.js index 1859bfc10a1..f9b4550e0e5 100644 --- a/src/test/specs/helpers.js +++ b/src/test/specs/helpers.js @@ -1,6 +1,6 @@ define([ - 'kbn', - 'lodash' + 'kbn', + 'lodash' ], function(kbn, _) { 'use strict'; @@ -24,7 +24,7 @@ define([ $provide.value('timeSrv', self.timeSrv); $provide.value('templateSrv', self.templateSrv); $provide.value('$element', self.$element); - _.each(mocks, function(key, value) { + _.each(mocks, function(value, key) { $provide.value(key, value); }); }); @@ -34,16 +34,20 @@ define([ return inject(function($controller, $rootScope, $q, $location) { self.scope = $rootScope.$new(); self.$location = $location; + self.scope.grafana = {}; self.scope.panel = {}; self.scope.row = { panels:[] }; self.scope.dashboard = {}; self.scope.dashboardViewState = new DashboardViewStateStub(); + self.scope.appEvent = sinon.spy(); + self.scope.onAppEvent = sinon.spy(); $rootScope.colors = []; for (var i = 0; i < 50; i++) { $rootScope.colors.push('#' + i); } self.$q = $q; self.scope.skipDataOnInit = true; + self.scope.skipAutoInit = true; self.controller = $controller(controllerName, { $scope: self.scope }); @@ -87,6 +91,7 @@ define([ } function TimeSrvStub() { + this.init = sinon.spy(); this.time = { from:'now-1h', to: 'now'}; this.timeRange = function(parse) { if (parse === false) {