From f72cfd38df56a374f675bb8e3cc0c492e5e26c09 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Mon, 9 Feb 2015 10:28:01 -0500 Subject: [PATCH] Explicitly declare dependencies in tests --- .../unit/directives/job-status-graph-test.js | 8 ++++---- .../unit/services/host-count-graph-data-test.js | 12 ++++++------ .../unit/services/job-status-graph-data-test.js | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/awx/ui/tests/unit/directives/job-status-graph-test.js b/awx/ui/tests/unit/directives/job-status-graph-test.js index c70423d6cb..573613e1c3 100644 --- a/awx/ui/tests/unit/directives/job-status-graph-test.js +++ b/awx/ui/tests/unit/directives/job-status-graph-test.js @@ -7,12 +7,12 @@ describe('Job Status Graph Directive', function() { beforeEach(module('Tower')); - beforeEach(module(function($provide) { + beforeEach(module(['$provide', function($provide) { $provide.value('LoadBasePaths', angular.noop); $provide.value('adjustGraphSize', resizeHandler); - })); + }])); - beforeEach(inject(function($rootScope, $compile, $httpBackend) { + beforeEach(inject(['$rootScope', '$compile', '$httpBackend', function($rootScope, $compile, $httpBackend) { httpBackend = $httpBackend; $httpBackend.expectGET('/static/js/local_config.js').respond({ }); @@ -38,7 +38,7 @@ describe('Job Status Graph Directive', function() { $httpBackend.flush(); - })); + }])); afterEach(function() { element.trigger('$destroy'); diff --git a/awx/ui/tests/unit/services/host-count-graph-data-test.js b/awx/ui/tests/unit/services/host-count-graph-data-test.js index 58f956f636..16cfa525ed 100644 --- a/awx/ui/tests/unit/services/host-count-graph-data-test.js +++ b/awx/ui/tests/unit/services/host-count-graph-data-test.js @@ -12,9 +12,9 @@ describe('Host Count Graph Data Service', function() { function flushPromises() { window.setTimeout(function() { - inject(function($rootScope) { + inject(['$rootScope', function($rootScope) { $rootScope.$apply(); - }, 1000); + }], 1000); }); } @@ -70,20 +70,20 @@ describe('Host Count Graph Data Service', function() { beforeEach(module("Tower")); - beforeEach(module(function($provide) { + beforeEach(module(['$provide', function($provide) { $provide.value("$cookieStore", { get: angular.noop }); $provide.value('ProcessErrors', processErrors); $provide.value('Rest', restStub); $provide.value('GetBasePath', getBasePath); - })); + }])); afterEach(function() { restStub.reset(); }); - beforeEach(inject(function(_hostCountGraphData_, $httpBackend, $q, $rootScope, $timeout) { + beforeEach(inject(['hostCountGraphData', '$httpBackend', '$q', '$rootScope', '$timeout', function(_hostCountGraphData_, $httpBackend, $q, $rootScope, $timeout) { hostCountGraphData = _hostCountGraphData_; httpBackend = $httpBackend; rootScope = $rootScope; @@ -91,7 +91,7 @@ describe('Host Count Graph Data Service', function() { $httpBackend.expectGET('/static/js/local_config.js').respond({ }); q = $q; - })); + }])); it('returns a promise to be fulfilled when data comes in', function() { var license = "license"; diff --git a/awx/ui/tests/unit/services/job-status-graph-data-test.js b/awx/ui/tests/unit/services/job-status-graph-data-test.js index fc0f4cd4bd..dd10540aa0 100644 --- a/awx/ui/tests/unit/services/job-status-graph-data-test.js +++ b/awx/ui/tests/unit/services/job-status-graph-data-test.js @@ -16,9 +16,9 @@ describe('Job Status Graph Data Service', function() { function flushPromises() { window.setTimeout(function() { - inject(function($rootScope) { + inject(['$rootScope', function($rootScope) { $rootScope.$apply(); - }); + }]); }); } @@ -44,20 +44,20 @@ describe('Job Status Graph Data Service', function() { beforeEach(module("Tower")); - beforeEach(module(function($provide) { + beforeEach(module(['$provide', function($provide) { $provide.value("$cookieStore", { get: angular.noop }); $provide.value('ProcessErrors', processErrors); $provide.value('Rest', restStub); $provide.value('GetBasePath', getBasePath); - })); + }])); afterEach(function() { restStub.reset(); }); - beforeEach(inject(function(_jobStatusGraphData_, $httpBackend, $q, $rootScope, $timeout) { + beforeEach(inject(['jobStatusGraphData', '$httpBackend', '$q', '$rootScope', '$timeout', function(_jobStatusGraphData_, $httpBackend, $q, $rootScope, $timeout) { jobStatusGraphData = _jobStatusGraphData_; httpBackend = $httpBackend; rootScope = $rootScope; @@ -65,7 +65,7 @@ describe('Job Status Graph Data Service', function() { $httpBackend.expectGET('/static/js/local_config.js').respond({ }); q = $q; - })); + }])); it('returns a promise to be fulfilled when data comes in', function() { var firstResult = "result"; @@ -101,14 +101,14 @@ describe('Job Status Graph Data Service', function() { var result = q.defer(); jobStatusGraphData.setupWatcher(); - inject(function($rootScope) { + inject(['$rootScope', function($rootScope) { $rootScope.$on('DataReceived:JobStatusGraph', function(e, data) { result.resolve(data); }); $rootScope.$emit('JobStatusChange'); restStub.succeed({ data: expected }); flushPromises(); - }); + }]); return expect(result.promise).to.eventually.equal(expected); });