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",