From fab9cf6fd11aafd0f0d3a3063628895503dc1da8 Mon Sep 17 00:00:00 2001 From: Cindy Lu Date: Fri, 4 Sep 2015 09:32:39 -0700 Subject: [PATCH] Clean up spec files in horizon framework directory We only need: beforeEach(module('horizon.framework')) as mentioned by Sean in table.controller.spec.js here: https://review.openstack.org/#/c/172602/19/ Change-Id: Id3bbbd151d0642d6fef1e6eca4bfb248371b0f08 --- doc/source/topics/javascript_testing.rst | 2 +- horizon/static/framework/util/bind-scope/bind-scope.spec.js | 2 -- horizon/static/framework/util/filters/filters.spec.js | 3 +-- horizon/static/framework/util/http/http.spec.js | 2 +- horizon/static/framework/util/i18n/i18n.spec.js | 2 +- horizon/static/framework/util/validators/validators.spec.js | 3 +-- horizon/static/framework/util/workflow/workflow.spec.js | 2 +- .../static/framework/widgets/charts/chart-tooltip.spec.js | 2 -- horizon/static/framework/widgets/charts/charts.spec.js | 2 +- horizon/static/framework/widgets/charts/pie-chart.spec.js | 2 -- .../static/framework/widgets/headers/headers.module.spec.js | 2 -- .../widgets/headers/hz-page-header.directive.spec.js | 2 -- .../widgets/help-panel/help-panel.directive.spec.js | 3 +-- .../widgets/magic-search/hz-magic-search-bar.spec.js | 2 +- .../framework/widgets/metadata/display/display.spec.js | 5 +---- horizon/static/framework/widgets/metadata/tree/tree.spec.js | 3 --- .../widgets/modal-wait-spinner/modal-wait-spinner.spec.js | 6 ++---- horizon/static/framework/widgets/toast/toast.spec.js | 6 ++---- .../transfer-table/transfer-table.controller.spec.js | 3 --- horizon/static/framework/widgets/widgets.module.spec.js | 2 +- horizon/static/framework/widgets/wizard/wizard.spec.js | 5 ++--- 21 files changed, 17 insertions(+), 44 deletions(-) diff --git a/doc/source/topics/javascript_testing.rst b/doc/source/topics/javascript_testing.rst index 49a210137b..94375e60f6 100644 --- a/doc/source/topics/javascript_testing.rst +++ b/doc/source/topics/javascript_testing.rst @@ -132,7 +132,7 @@ Lines added to ``horizon/test/jasmine/jasmine_tests.py``: describe('horizon.framework.widgets.modal module', function() { - beforeEach(module('horizon.framework.widgets.modal')); + beforeEach(module('horizon.framework')); describe('simpleModalCtrl', function() { var scope; diff --git a/horizon/static/framework/util/bind-scope/bind-scope.spec.js b/horizon/static/framework/util/bind-scope/bind-scope.spec.js index db80307c68..fc5d8d58de 100644 --- a/horizon/static/framework/util/bind-scope/bind-scope.spec.js +++ b/horizon/static/framework/util/bind-scope/bind-scope.spec.js @@ -11,8 +11,6 @@ var $scope, $element; beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.util.bind-scope')); beforeEach(module('horizon.framework.util.bind-scope', function ($compileProvider) { /* eslint-disable angular/ng_module_getter */ diff --git a/horizon/static/framework/util/filters/filters.spec.js b/horizon/static/framework/util/filters/filters.spec.js index 18b142948b..3c701d0df3 100644 --- a/horizon/static/framework/util/filters/filters.spec.js +++ b/horizon/static/framework/util/filters/filters.spec.js @@ -2,8 +2,7 @@ 'use strict'; describe('horizon.framework.util.filters', function () { - beforeEach(module('horizon.framework.util.i18n')); - beforeEach(module('horizon.framework.util.filters')); + beforeEach(module('horizon.framework')); describe('yesno', function () { var yesnoFilter; diff --git a/horizon/static/framework/util/http/http.spec.js b/horizon/static/framework/util/http/http.spec.js index f935055f45..d1f410d684 100644 --- a/horizon/static/framework/util/http/http.spec.js +++ b/horizon/static/framework/util/http/http.spec.js @@ -10,7 +10,7 @@ describe('api service', function () { var api, $httpBackend; - beforeEach(module('horizon.framework.util.http')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { api = $injector.get('horizon.framework.util.http.service'); $httpBackend = $injector.get('$httpBackend'); diff --git a/horizon/static/framework/util/i18n/i18n.spec.js b/horizon/static/framework/util/i18n/i18n.spec.js index fd7a3820a4..04d2e8bc03 100644 --- a/horizon/static/framework/util/i18n/i18n.spec.js +++ b/horizon/static/framework/util/i18n/i18n.spec.js @@ -17,7 +17,7 @@ 'use strict'; describe('horizon.framework.util.i18n', function () { - beforeEach(module('horizon.framework.util.i18n')); + beforeEach(module('horizon.framework')); describe('gettext', function () { var factory; diff --git a/horizon/static/framework/util/validators/validators.spec.js b/horizon/static/framework/util/validators/validators.spec.js index f32acaeb22..e57997a005 100644 --- a/horizon/static/framework/util/validators/validators.spec.js +++ b/horizon/static/framework/util/validators/validators.spec.js @@ -8,8 +8,7 @@ }); describe('validators directive', function () { - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.util.validators')); + beforeEach(module('horizon.framework')); describe('validateNumberMax directive', function () { var $scope, $form; diff --git a/horizon/static/framework/util/workflow/workflow.spec.js b/horizon/static/framework/util/workflow/workflow.spec.js index 81683d994b..f693a61225 100644 --- a/horizon/static/framework/util/workflow/workflow.spec.js +++ b/horizon/static/framework/util/workflow/workflow.spec.js @@ -19,7 +19,7 @@ } ]; - beforeEach(module('horizon.framework.util.workflow')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { workflow = $injector.get('horizon.framework.util.workflow.service'); diff --git a/horizon/static/framework/widgets/charts/chart-tooltip.spec.js b/horizon/static/framework/widgets/charts/chart-tooltip.spec.js index 2322a3c6ab..11a9f7748f 100644 --- a/horizon/static/framework/widgets/charts/chart-tooltip.spec.js +++ b/horizon/static/framework/widgets/charts/chart-tooltip.spec.js @@ -21,8 +21,6 @@ beforeEach(module('templates')); beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.charts')); beforeEach(inject(function (_$compile_, _$rootScope_) { var $compile = _$compile_; diff --git a/horizon/static/framework/widgets/charts/charts.spec.js b/horizon/static/framework/widgets/charts/charts.spec.js index 03dc2de717..4a36160c1f 100644 --- a/horizon/static/framework/widgets/charts/charts.spec.js +++ b/horizon/static/framework/widgets/charts/charts.spec.js @@ -24,7 +24,7 @@ describe('showKeyFilter', function () { var showKeyFilter; - beforeEach(module('horizon.framework.widgets.charts')); + beforeEach(module('horizon.framework')); beforeEach(inject(function (_showKeyFilterFilter_) { showKeyFilter = _showKeyFilterFilter_; diff --git a/horizon/static/framework/widgets/charts/pie-chart.spec.js b/horizon/static/framework/widgets/charts/pie-chart.spec.js index 0521b919f0..8932c43203 100644 --- a/horizon/static/framework/widgets/charts/pie-chart.spec.js +++ b/horizon/static/framework/widgets/charts/pie-chart.spec.js @@ -30,8 +30,6 @@ beforeEach(module('templates')); beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.charts')); function cleanSpaces(string) { return string.trim().replace(/\s+/, ' '); diff --git a/horizon/static/framework/widgets/headers/headers.module.spec.js b/horizon/static/framework/widgets/headers/headers.module.spec.js index f2907996f2..72055e3b93 100644 --- a/horizon/static/framework/widgets/headers/headers.module.spec.js +++ b/horizon/static/framework/widgets/headers/headers.module.spec.js @@ -26,8 +26,6 @@ var headersBasePath, staticUrl; beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.headers')); beforeEach(inject(function ($injector) { headersBasePath = $injector.get('horizon.framework.widgets.headers.basePath'); staticUrl = $injector.get('$window').STATIC_URL; diff --git a/horizon/static/framework/widgets/headers/hz-page-header.directive.spec.js b/horizon/static/framework/widgets/headers/hz-page-header.directive.spec.js index 23038a6f7e..f30b83ca3b 100644 --- a/horizon/static/framework/widgets/headers/hz-page-header.directive.spec.js +++ b/horizon/static/framework/widgets/headers/hz-page-header.directive.spec.js @@ -29,8 +29,6 @@ beforeEach(module('templates')); beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.headers')); beforeEach(inject(function ($injector) { $compile = $injector.get('$compile'); diff --git a/horizon/static/framework/widgets/help-panel/help-panel.directive.spec.js b/horizon/static/framework/widgets/help-panel/help-panel.directive.spec.js index 1f925ffea8..fe8182142c 100644 --- a/horizon/static/framework/widgets/help-panel/help-panel.directive.spec.js +++ b/horizon/static/framework/widgets/help-panel/help-panel.directive.spec.js @@ -21,8 +21,7 @@ element; beforeEach(module('templates')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.help-panel')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { $scope = $injector.get('$rootScope').$new(); $compile = $injector.get('$compile'); diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.spec.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.spec.js index a0b7ba5c96..884c8f98a8 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.spec.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.spec.js @@ -22,7 +22,7 @@ beforeEach(module('templates')); beforeEach(module('smart-table')); - beforeEach(module('horizon.framework.widgets')); + beforeEach(module('horizon.framework')); beforeEach(module('MagicSearch')); beforeEach(inject(function ($injector) { diff --git a/horizon/static/framework/widgets/metadata/display/display.spec.js b/horizon/static/framework/widgets/metadata/display/display.spec.js index ec6001dc4a..d53152d1e7 100644 --- a/horizon/static/framework/widgets/metadata/display/display.spec.js +++ b/horizon/static/framework/widgets/metadata/display/display.spec.js @@ -108,10 +108,7 @@ var $scope, $element; beforeEach(module('templates')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.metadata')); - beforeEach(module('horizon.framework.widgets.metadata.tree')); - beforeEach(module('horizon.framework.widgets.metadata.display')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { var $compile = $injector.get('$compile'); $scope = $injector.get('$rootScope').$new(); diff --git a/horizon/static/framework/widgets/metadata/tree/tree.spec.js b/horizon/static/framework/widgets/metadata/tree/tree.spec.js index 9445f15374..766d5724f9 100644 --- a/horizon/static/framework/widgets/metadata/tree/tree.spec.js +++ b/horizon/static/framework/widgets/metadata/tree/tree.spec.js @@ -103,9 +103,6 @@ beforeEach(module('templates')); beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.metadata')); - beforeEach(module('horizon.framework.widgets.metadata.tree')); describe('metadataTree directive', function () { diff --git a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js index 7408f6e10b..baefe6b7e1 100644 --- a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js +++ b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js @@ -20,8 +20,7 @@ var service, modal; beforeEach(module('ui.bootstrap')); - beforeEach(module('horizon.framework.conf')); - beforeEach(module('horizon.framework.widgets.modal-wait-spinner')); + beforeEach(module('horizon.framework')); beforeEach(inject(function($injector, $modal) { service = $injector.get('horizon.framework.widgets.modal-wait-spinner.service'); @@ -75,8 +74,7 @@ var $scope, $element, $timeout; beforeEach(module('ui.bootstrap')); - beforeEach(module('horizon.framework.conf')); - beforeEach(module('horizon.framework.widgets.modal-wait-spinner')); + beforeEach(module('horizon.framework')); beforeEach(inject(function($injector) { var $compile = $injector.get('$compile'); diff --git a/horizon/static/framework/widgets/toast/toast.spec.js b/horizon/static/framework/widgets/toast/toast.spec.js index 18decd59fc..0c34b04652 100644 --- a/horizon/static/framework/widgets/toast/toast.spec.js +++ b/horizon/static/framework/widgets/toast/toast.spec.js @@ -33,8 +33,7 @@ var infoMsg = "I am info."; beforeEach(module('templates')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.toast')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { service = $injector.get('horizon.framework.widgets.toast.service'); $scope = $injector.get('$rootScope').$new(); @@ -107,8 +106,7 @@ } beforeEach(module('templates')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.toast')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { $scope = $injector.get('$rootScope').$new(); $compile = $injector.get('$compile'); diff --git a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js index 25fb3c22f7..dd6a994974 100644 --- a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js +++ b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js @@ -22,9 +22,6 @@ beforeEach(module('templates')); beforeEach(module('smart-table')); beforeEach(module('horizon.framework')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.table')); - beforeEach(module('horizon.framework.widgets.transfer-table')); var log, params; beforeEach(module(function($provide) { diff --git a/horizon/static/framework/widgets/widgets.module.spec.js b/horizon/static/framework/widgets/widgets.module.spec.js index c4168252da..fb75ab6e47 100644 --- a/horizon/static/framework/widgets/widgets.module.spec.js +++ b/horizon/static/framework/widgets/widgets.module.spec.js @@ -23,7 +23,7 @@ }); describe('horizon.framework.widgets.basePath', function () { - beforeEach(module('horizon.framework.widgets')); + beforeEach(module('horizon.framework')); it('should be defined and set correctly', inject([ 'horizon.framework.widgets.basePath', '$window', diff --git a/horizon/static/framework/widgets/wizard/wizard.spec.js b/horizon/static/framework/widgets/wizard/wizard.spec.js index 694e4727a4..608b358d84 100644 --- a/horizon/static/framework/widgets/wizard/wizard.spec.js +++ b/horizon/static/framework/widgets/wizard/wizard.spec.js @@ -28,8 +28,7 @@ element; beforeEach(module('templates')); - beforeEach(module('horizon.framework.widgets')); - beforeEach(module('horizon.framework.widgets.wizard')); + beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { $scope = $injector.get('$rootScope').$new(); $compile = $injector.get('$compile'); @@ -197,7 +196,7 @@ describe("ModalContainerController", function() { var ctrl, scope, modalInstance, launchContext; - beforeEach(module('horizon.framework.widgets.wizard')); + beforeEach(module('horizon.framework')); beforeEach(inject(function($controller) { scope = {};