From 7486503a169bc534404f73e12b4434f822060337 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Fri, 22 Sep 2017 16:52:01 -0400 Subject: [PATCH 1/4] Add Layout directive unit tests --- .../lib/components/layout/layout.directive.js | 2 +- awx/ui/client/test/unit/index.js | 4 + awx/ui/client/test/unit/layout.spec.js | 170 ++++++++++++++++++ awx/ui/package.json | 2 +- 4 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 awx/ui/client/test/unit/layout.spec.js diff --git a/awx/ui/client/lib/components/layout/layout.directive.js b/awx/ui/client/lib/components/layout/layout.directive.js index 0f40ce7868..0af7746d57 100644 --- a/awx/ui/client/lib/components/layout/layout.directive.js +++ b/awx/ui/client/lib/components/layout/layout.directive.js @@ -18,7 +18,7 @@ function AtLayoutController ($scope, strings) { $scope.$watch('$root.socketStatus', (newStatus) => { vm.socketState = newStatus; - vm.socketIconClass = `icon-socket-${$scope.socketStatus}`; + vm.socketIconClass = `icon-socket-${vm.socketState}`; }); $scope.$watch('$root.licenseMissing', (licenseMissing) => { diff --git a/awx/ui/client/test/unit/index.js b/awx/ui/client/test/unit/index.js index aa4f73ab95..738fb8fe14 100644 --- a/awx/ui/client/test/unit/index.js +++ b/awx/ui/client/test/unit/index.js @@ -1,11 +1,15 @@ // Import angular and angular-mocks to the global scope import 'angular'; import 'angular-mocks'; +import 'angular-gettext'; +import 'angular-ui-router'; // Import custom Angular module dependencies import '../../src/i18n'; import '../../lib/services'; import '../../lib/components'; +import '../../lib/models'; // Import tests import './panel-body.spec'; +import './layout.spec'; diff --git a/awx/ui/client/test/unit/layout.spec.js b/awx/ui/client/test/unit/layout.spec.js new file mode 100644 index 0000000000..5d032caf61 --- /dev/null +++ b/awx/ui/client/test/unit/layout.spec.js @@ -0,0 +1,170 @@ +describe('Components | Layout', () => { + let $compile; + let $rootScope; + let element; + let scope; + + beforeEach(() => { + angular.mock.module('gettext'); + angular.mock.module('I18N'); + angular.mock.module('ui.router'); + angular.mock.module('at.lib.services') + angular.mock.module('at.lib.components') + }); + + beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { + $compile = _$compile_; + $rootScope = _$rootScope_; + scope = $rootScope.$new(); + + element = angular.element(''); + element = $compile(element)(scope); + scope.$digest(); + })); + + describe('AtLayoutController', () => { + let controller; + + beforeEach(()=> { + controller = element.controller('atLayout'); + }); + + it('$scope.$on($stateChangeSuccess) should assign toState name to currentState', () => { + let next = {'name': 'dashboard'}; + $rootScope.$broadcast('$stateChangeSuccess', next); + expect(controller.currentState).toBe('dashboard'); + }); + + describe('$root.current_user watcher should assign value to ', () => { + beforeEach(() => { + let val = { + username: 'admin', + id: 1 + }; + $rootScope.current_user = val; + scope.$digest(); + }); + + it('isLoggedIn', () => { + expect(controller.isLoggedIn).toBe('admin'); + + $rootScope.current_user = { id: 1 }; + scope.$digest(); + expect(controller.isLoggedIn).not.toBeDefined(); + }); + + it('isSuperUser', () => { + $rootScope.current_user = 'one'; + $rootScope.user_is_superuser = true; + $rootScope.user_is_system_auditor = false; + scope.$digest(); + expect(controller.isSuperUser).toBe(true); + + $rootScope.current_user = 'two'; + $rootScope.user_is_superuser = false; + $rootScope.user_is_system_auditor = true; + scope.$digest(); + expect(controller.isSuperUser).toBe(true); + + $rootScope.current_user = 'three'; + $rootScope.user_is_superuser = true; + $rootScope.user_is_system_auditor = true; + scope.$digest(); + expect(controller.isSuperUser).toBe(true); + + $rootScope.current_user = 'four'; + $rootScope.user_is_superuser = false; + $rootScope.user_is_system_auditor = false; + scope.$digest(); + expect(controller.isSuperUser).toBe(false); + }); + + it('currentUsername', () => { + expect(controller.currentUsername).toBeTruthy(); + expect(controller.currentUsername).toBe('admin'); + }); + + it('currentUserId', () => { + expect(controller.currentUserId).toBeTruthy(); + expect(controller.currentUserId).toBe(1); + }); + + }); + + describe('$root.socketStatus watcher should assign newStatus to', () => { + let statuses = ['connecting', 'error', 'ok']; + + it('socketState', () => { + _.forEach(statuses, (status) => { + $rootScope.socketStatus = status; + scope.$digest(); + expect(controller.socketState).toBeTruthy(); + expect(controller.socketState).toBe(status); + }); + }); + + it('socketIconClass', () => { + _.forEach(statuses, (status) => { + $rootScope.socketStatus = status; + scope.$digest(); + expect(controller.socketIconClass).toBe(`icon-socket-${status}`); + }); + }); + }); + + describe('$root.licenseMissing watcher should assign true or false to', () => { + it('licenseIsMissing', () => { + $rootScope.licenseMissing = true; + scope.$digest(); + expect(controller.licenseIsMissing).toBe(true); + + $rootScope.licenseMissing = false; + scope.$digest(); + expect(controller.licenseIsMissing).toBe(false); + }); + }); + + describe('getString()', () => { + it('should return layout string', () => { + let layoutStrings = { + CURRENT_USER_LABEL: 'Logged in as', + VIEW_DOCS: 'View Documentation', + LOGOUT: 'Logout', + DASHBOARD: 'Dashboard', + JOBS: 'Jobs', + SCHEDULES: 'Schedules', + PORTAL_MODE: 'Portal Mode', + PROJECTS: 'Projects', + CREDENTIALS: 'Credentials', + CREDENTIAL_TYPES: 'Credential Types', + INVENTORIES: 'Inventories', + TEMPLATES: 'Templates', + ORGANIZATIONS: 'Organizations', + USERS: 'Users', + TEAMS: 'Teams', + INVENTORY_SCRIPTS: 'Inventory Scripts', + NOTIFICATIONS: 'Notifications', + MANAGEMENT_JOBS: 'Management Jobs', + INSTANCE_GROUPS: 'Instance Groups', + SETTINGS: 'Settings', + FOOTER_ABOUT: 'About', + FOOTER_COPYRIGHT: 'Copyright © 2017 Red Hat, Inc.' + }; + + _.forEach(layoutStrings, (value, key) => { + expect(controller.getString(key)).toBe(value); + }); + }); + + it('should return default string', () => { + let defaultStrings = { + BRAND_NAME: "AWX" + }; + + _.forEach(defaultStrings, (value, key) => { + expect(controller.getString(key)).toBe(value); + }); + }); + }); + }); +}); \ No newline at end of file diff --git a/awx/ui/package.json b/awx/ui/package.json index 3cb89bcec5..14065392d2 100644 --- a/awx/ui/package.json +++ b/awx/ui/package.json @@ -25,7 +25,7 @@ "jshint": "grunt jshint:source --no-color", "test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=PhantomJS", "e2e": "./client/test/e2e/runner.js --config ./client/test/e2e/nightwatch.conf.js", - "component-test": "karma start client/test/karma.conf.js", + "component-test": "karma start client/test/unit/karma.conf.js --auto-watch --no-single-run", "lint": "eslint -c .eslintrc.js .", "dev": "webpack --config build/webpack.development.js --progress", "watch": "webpack-dev-server --config build/webpack.watch.js --progress", From 5c5293783dd8d832ab5ad02347df6219f8dea35e Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Tue, 26 Sep 2017 14:20:30 -0400 Subject: [PATCH 2/4] Add Side Nav directive unit tests --- awx/ui/client/test/unit/index.js | 1 + awx/ui/client/test/unit/side-nav.spec.js | 46 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 awx/ui/client/test/unit/side-nav.spec.js diff --git a/awx/ui/client/test/unit/index.js b/awx/ui/client/test/unit/index.js index 738fb8fe14..448f41b680 100644 --- a/awx/ui/client/test/unit/index.js +++ b/awx/ui/client/test/unit/index.js @@ -13,3 +13,4 @@ import '../../lib/models'; // Import tests import './panel-body.spec'; import './layout.spec'; +import './side-nav.spec'; diff --git a/awx/ui/client/test/unit/side-nav.spec.js b/awx/ui/client/test/unit/side-nav.spec.js new file mode 100644 index 0000000000..cfb1d61812 --- /dev/null +++ b/awx/ui/client/test/unit/side-nav.spec.js @@ -0,0 +1,46 @@ +describe('Components | Side Nav', () => { + let $compile; + let $rootScope; + let element; + let scope; + + beforeEach(() => { + angular.mock.module('gettext'); + angular.mock.module('I18N'); + angular.mock.module('ui.router'); + angular.mock.module('at.lib.services') + angular.mock.module('at.lib.components') + }); + + beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { + $compile = _$compile_; + $rootScope = _$rootScope_; + scope = $rootScope.$new(); + + element = angular.element(""); + element = $compile(element)(scope); + scope.$digest(); + })); + + describe('Side Nav Controller', () => { + let sideNav; + let sideNavCtrl; + + beforeEach(() => { + sideNav = angular.element(element[0].querySelector('.at-Layout-side')); + sideNavCtrl = sideNav.controller('atSideNav'); + }); + + it('isExpanded defaults to false', () => { + expect(sideNavCtrl.isExpanded).toBe(false); + }); + + it('toggleExpansion()', () => { + sideNavCtrl.toggleExpansion(); + expect(sideNavCtrl.isExpanded).toBe(true); + + sideNavCtrl.toggleExpansion(); + expect(sideNavCtrl.isExpanded).toBe(false); + }); + }); +}); From 2f8155763b8872223b888420fe38a26041ad1c22 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Wed, 27 Sep 2017 09:43:28 -0400 Subject: [PATCH 3/4] Add Side Nav Item unit tests Signed-off-by: Marliana Lara --- .../components/layout/side-nav.directive.js | 2 +- awx/ui/client/test/unit/index.js | 3 +- awx/ui/client/test/unit/karma.conf.js | 10 +-- awx/ui/client/test/unit/layout.spec.js | 34 ++++------- awx/ui/client/test/unit/side-nav-item.spec.js | 61 +++++++++++++++++++ awx/ui/client/test/unit/side-nav.spec.js | 34 ++++++++++- awx/ui/package.json | 2 +- 7 files changed, 116 insertions(+), 30 deletions(-) create mode 100644 awx/ui/client/test/unit/side-nav-item.spec.js diff --git a/awx/ui/client/lib/components/layout/side-nav.directive.js b/awx/ui/client/lib/components/layout/side-nav.directive.js index f089d54eee..672d23d886 100644 --- a/awx/ui/client/lib/components/layout/side-nav.directive.js +++ b/awx/ui/client/lib/components/layout/side-nav.directive.js @@ -5,7 +5,7 @@ let $document; function atSideNavLink (scope, element, attrs, ctrl) { scope.layoutVm = ctrl; - $document.on('click', (e) => { + $(document).on('click', (e) => { if ($(e.target).parents('.at-Layout-side').length === 0) { scope.$emit('clickOutsideSideNav'); } diff --git a/awx/ui/client/test/unit/index.js b/awx/ui/client/test/unit/index.js index 448f41b680..0090365719 100644 --- a/awx/ui/client/test/unit/index.js +++ b/awx/ui/client/test/unit/index.js @@ -1,8 +1,6 @@ // Import angular and angular-mocks to the global scope import 'angular'; import 'angular-mocks'; -import 'angular-gettext'; -import 'angular-ui-router'; // Import custom Angular module dependencies import '../../src/i18n'; @@ -14,3 +12,4 @@ import '../../lib/models'; import './panel-body.spec'; import './layout.spec'; import './side-nav.spec'; +import './side-nav-item.spec'; \ No newline at end of file diff --git a/awx/ui/client/test/unit/karma.conf.js b/awx/ui/client/test/unit/karma.conf.js index e3343b0a00..988db3c462 100644 --- a/awx/ui/client/test/unit/karma.conf.js +++ b/awx/ui/client/test/unit/karma.conf.js @@ -11,8 +11,9 @@ module.exports = config => { browsers: ['PhantomJS'], reporters: ['progress'], files: [ - './index.js', - '../../lib/components/**/*.html' + './index.js', + '../../../client/src/app.js', + '../../lib/components/**/*.html' ], plugins: [ 'karma-webpack', @@ -21,8 +22,9 @@ module.exports = config => { 'karma-ng-html2js-preprocessor' ], preprocessors: { - '../../lib/components/**/*.html': 'ng-html2js', - './index.js': 'webpack' + './index.js': 'webpack', + '../../../client/src/app.js': 'webpack', + '../../lib/components/**/*.html': 'ng-html2js' }, ngHtml2JsPreprocessor: { moduleName: 'at.test.templates', diff --git a/awx/ui/client/test/unit/layout.spec.js b/awx/ui/client/test/unit/layout.spec.js index 5d032caf61..512cfbef50 100644 --- a/awx/ui/client/test/unit/layout.spec.js +++ b/awx/ui/client/test/unit/layout.spec.js @@ -3,13 +3,14 @@ describe('Components | Layout', () => { let $rootScope; let element; let scope; + let i18n; beforeEach(() => { angular.mock.module('gettext'); angular.mock.module('I18N'); angular.mock.module('ui.router'); - angular.mock.module('at.lib.services') - angular.mock.module('at.lib.components') + angular.mock.module('at.lib.services'); + angular.mock.module('at.lib.components'); }); beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { @@ -125,30 +126,21 @@ describe('Components | Layout', () => { }); describe('getString()', () => { + it('calls ComponentsStrings get() method', angular.mock.inject((_ComponentsStrings_) => { + spyOn(_ComponentsStrings_, 'get'); + controller.getString('VIEW_DOCS') + expect(_ComponentsStrings_.get).toHaveBeenCalled(); + })); + + it('ComponentsStrings get() method should throw an error if string is not a property name of the layout class', () => { + expect(controller.getString.bind(null, 'SUBMISSION_ERROR_TITLE')).toThrow(); + }); + it('should return layout string', () => { let layoutStrings = { CURRENT_USER_LABEL: 'Logged in as', VIEW_DOCS: 'View Documentation', LOGOUT: 'Logout', - DASHBOARD: 'Dashboard', - JOBS: 'Jobs', - SCHEDULES: 'Schedules', - PORTAL_MODE: 'Portal Mode', - PROJECTS: 'Projects', - CREDENTIALS: 'Credentials', - CREDENTIAL_TYPES: 'Credential Types', - INVENTORIES: 'Inventories', - TEMPLATES: 'Templates', - ORGANIZATIONS: 'Organizations', - USERS: 'Users', - TEAMS: 'Teams', - INVENTORY_SCRIPTS: 'Inventory Scripts', - NOTIFICATIONS: 'Notifications', - MANAGEMENT_JOBS: 'Management Jobs', - INSTANCE_GROUPS: 'Instance Groups', - SETTINGS: 'Settings', - FOOTER_ABOUT: 'About', - FOOTER_COPYRIGHT: 'Copyright © 2017 Red Hat, Inc.' }; _.forEach(layoutStrings, (value, key) => { diff --git a/awx/ui/client/test/unit/side-nav-item.spec.js b/awx/ui/client/test/unit/side-nav-item.spec.js new file mode 100644 index 0000000000..f605a40e69 --- /dev/null +++ b/awx/ui/client/test/unit/side-nav-item.spec.js @@ -0,0 +1,61 @@ +describe('Components | Side Nav Item', () => { + let $compile; + let $rootScope; + let element; + let scope; + + beforeEach(() => { + angular.mock.module('gettext'); + angular.mock.module('I18N'); + angular.mock.module('ui.router'); + angular.mock.module('at.lib.services') + angular.mock.module('at.lib.components') + }); + + beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { + $compile = _$compile_; + $rootScope = _$rootScope_; + scope = $rootScope.$new(); + + element = angular.element(''); + element = $compile(element)(scope); + scope.name = 'dashboard'; + scope.$digest(); + })); + + describe('Side Nav Item Controller', () => { + let LayoutCtrl; + let SideNavItem; + let SideNavItemCtrl; + + beforeEach(() => { + SideNavItem = angular.element(element[0].querySelector('at-side-nav-item')); + SideNavItemCtrl = SideNavItem.controller('atSideNavItem'); + }); + + it('layoutVm.currentState watcher should assign isRoute', () => { + let current = {'name': 'dashboard'}; + $rootScope.$broadcast('$stateChangeSuccess', current); + scope.$digest(); + expect(SideNavItemCtrl.isRoute).toBe(true); + + current = {'name': 'inventories'}; + $rootScope.$broadcast('$stateChangeSuccess', current); + scope.$digest(); + expect(SideNavItemCtrl.isRoute).toBe(false); + }); + + it('go() should call $state.go()', angular.mock.inject((_$state_) => { + spyOn(_$state_, 'go'); + SideNavItemCtrl.go(); + expect(_$state_.go).toHaveBeenCalled(); + expect(_$state_.go).toHaveBeenCalledWith('dashboard', jasmine.any(Object), jasmine.any(Object)); + })); + + it('should load name, icon, and route from scope', () => { + expect(SideNavItem.isolateScope().name).toBeDefined(); + expect(SideNavItem.isolateScope().iconClass).toBeDefined(); + expect(SideNavItem.isolateScope().route).toBeDefined(); + }); + }); +}); diff --git a/awx/ui/client/test/unit/side-nav.spec.js b/awx/ui/client/test/unit/side-nav.spec.js index cfb1d61812..1342e41659 100644 --- a/awx/ui/client/test/unit/side-nav.spec.js +++ b/awx/ui/client/test/unit/side-nav.spec.js @@ -3,13 +3,18 @@ describe('Components | Side Nav', () => { let $rootScope; let element; let scope; + let windowMock = { + innerWidth: 500 + }; beforeEach(() => { angular.mock.module('gettext'); angular.mock.module('I18N'); angular.mock.module('ui.router'); angular.mock.module('at.lib.services') - angular.mock.module('at.lib.components') + angular.mock.module('at.lib.components', ($provide) => { + $provide.value('$window', windowMock); + }); }); beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { @@ -36,11 +41,38 @@ describe('Components | Side Nav', () => { }); it('toggleExpansion()', () => { + expect(sideNavCtrl.isExpanded).toBe(false); + + sideNavCtrl.toggleExpansion(); + expect(sideNavCtrl.isExpanded).toBe(true); + + sideNavCtrl.toggleExpansion(); + expect(sideNavCtrl.isExpanded).toBe(false); + sideNavCtrl.toggleExpansion(); expect(sideNavCtrl.isExpanded).toBe(true); sideNavCtrl.toggleExpansion(); expect(sideNavCtrl.isExpanded).toBe(false); }); + + it('isExpanded should be false after state change event', () => { + sideNavCtrl.isExpanded = true; + + let current = { + 'name': 'dashboard' + }; + $rootScope.$broadcast('$stateChangeSuccess', current); + scope.$digest(); + expect(sideNavCtrl.isExpanded).toBe(false); + }); + + it('clickOutsideSideNav watcher should assign isExpanded to false', () => { + sideNavCtrl.isExpanded = true; + + $rootScope.$broadcast('clickOutsideSideNav'); + scope.$digest(); + expect(sideNavCtrl.isExpanded).toBe(false); + }); }); }); diff --git a/awx/ui/package.json b/awx/ui/package.json index 14065392d2..f7ab064cee 100644 --- a/awx/ui/package.json +++ b/awx/ui/package.json @@ -25,7 +25,7 @@ "jshint": "grunt jshint:source --no-color", "test:ci": "npm run test -- --single-run --reporter junit,dots --browsers=PhantomJS", "e2e": "./client/test/e2e/runner.js --config ./client/test/e2e/nightwatch.conf.js", - "component-test": "karma start client/test/unit/karma.conf.js --auto-watch --no-single-run", + "component-test": "karma start client/test/unit/karma.conf.js", "lint": "eslint -c .eslintrc.js .", "dev": "webpack --config build/webpack.development.js --progress", "watch": "webpack-dev-server --config build/webpack.watch.js --progress", From e19b4e0c8ccd4f690271de2c4c6e015e41c3fbb2 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Mon, 2 Oct 2017 14:57:45 -0400 Subject: [PATCH 4/4] Fix karma config and remove karma-ng-html2js-preprocessor --- .../components/layout/side-nav.directive.js | 2 +- awx/ui/client/test/unit/index.js | 8 ------- awx/ui/client/test/unit/karma.conf.js | 22 +++++++---------- awx/ui/client/test/unit/panel-body.spec.js | 24 ------------------- awx/ui/package.json | 1 - 5 files changed, 9 insertions(+), 48 deletions(-) delete mode 100644 awx/ui/client/test/unit/panel-body.spec.js diff --git a/awx/ui/client/lib/components/layout/side-nav.directive.js b/awx/ui/client/lib/components/layout/side-nav.directive.js index 672d23d886..f089d54eee 100644 --- a/awx/ui/client/lib/components/layout/side-nav.directive.js +++ b/awx/ui/client/lib/components/layout/side-nav.directive.js @@ -5,7 +5,7 @@ let $document; function atSideNavLink (scope, element, attrs, ctrl) { scope.layoutVm = ctrl; - $(document).on('click', (e) => { + $document.on('click', (e) => { if ($(e.target).parents('.at-Layout-side').length === 0) { scope.$emit('clickOutsideSideNav'); } diff --git a/awx/ui/client/test/unit/index.js b/awx/ui/client/test/unit/index.js index 0090365719..d26d4c6870 100644 --- a/awx/ui/client/test/unit/index.js +++ b/awx/ui/client/test/unit/index.js @@ -1,15 +1,7 @@ // Import angular and angular-mocks to the global scope -import 'angular'; import 'angular-mocks'; -// Import custom Angular module dependencies -import '../../src/i18n'; -import '../../lib/services'; -import '../../lib/components'; -import '../../lib/models'; - // Import tests -import './panel-body.spec'; import './layout.spec'; import './side-nav.spec'; import './side-nav-item.spec'; \ No newline at end of file diff --git a/awx/ui/client/test/unit/karma.conf.js b/awx/ui/client/test/unit/karma.conf.js index 988db3c462..b0b33eb6cd 100644 --- a/awx/ui/client/test/unit/karma.conf.js +++ b/awx/ui/client/test/unit/karma.conf.js @@ -1,4 +1,3 @@ -let path = require('path'); const webpackConfig = require('../../../build/webpack.test.js'); module.exports = config => { @@ -11,31 +10,26 @@ module.exports = config => { browsers: ['PhantomJS'], reporters: ['progress'], files: [ - './index.js', + '../../../client/src/vendor.js', '../../../client/src/app.js', - '../../lib/components/**/*.html' + '../../../client/src/**/*.html', + './index.js', ], plugins: [ 'karma-webpack', 'karma-jasmine', 'karma-phantomjs-launcher', - 'karma-ng-html2js-preprocessor' + 'karma-html2js-preprocessor' ], preprocessors: { - './index.js': 'webpack', + '../../../client/src/vendor.js': 'webpack', '../../../client/src/app.js': 'webpack', - '../../lib/components/**/*.html': 'ng-html2js' - }, - ngHtml2JsPreprocessor: { - moduleName: 'at.test.templates', - cacheIdFromPath: function (filepath) { - filepath = filepath.replace(path.join(__dirname, '../../lib'), ''); - return '/static/partials' + filepath; - } + '../../../client/src/**/*.html': 'html2js', + './index.js': 'webpack' }, webpack: webpackConfig, webpackMiddleware: { noInfo: 'errors-only' } }); -}; +}; \ No newline at end of file diff --git a/awx/ui/client/test/unit/panel-body.spec.js b/awx/ui/client/test/unit/panel-body.spec.js deleted file mode 100644 index 3915195847..0000000000 --- a/awx/ui/client/test/unit/panel-body.spec.js +++ /dev/null @@ -1,24 +0,0 @@ -describe('Components | panel/body', () => { - - let $compile; - let $rootScope; - - beforeEach(() => { - angular.mock.module('at.lib.services') - angular.mock.module('at.lib.components') - angular.mock.module('at.test.templates'); - }); - - beforeEach(angular.mock.inject((_$compile_, _$rootScope_) => { - $compile = _$compile_; - $rootScope = _$rootScope_; - })); - - it('Should produce at-Panel-body HTML content', () => { - let element = $compile('yo')($rootScope); - $rootScope.$digest(); - - expect(element.hasClass('at-Panel-body')).toBe(true); - expect(element.html()).toContain('yo'); - }); -}); diff --git a/awx/ui/package.json b/awx/ui/package.json index f7ab064cee..e6893ae15c 100644 --- a/awx/ui/package.json +++ b/awx/ui/package.json @@ -70,7 +70,6 @@ "karma-html2js-preprocessor": "^1.0.0", "karma-jasmine": "^1.1.0", "karma-junit-reporter": "^1.2.0", - "karma-ng-html2js-preprocessor": "^1.0.0", "karma-phantomjs-launcher": "^1.0.2", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^2.0.4",