mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Fix karma config and remove karma-ng-html2js-preprocessor
This commit is contained in:
parent
2f8155763b
commit
e19b4e0c8c
@ -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');
|
||||
}
|
||||
|
||||
@ -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';
|
||||
@ -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'
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
@ -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('<at-panel-body>yo</at-panel-body>')($rootScope);
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(element.hasClass('at-Panel-body')).toBe(true);
|
||||
expect(element.html()).toContain('yo');
|
||||
});
|
||||
});
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user