Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Angular 1.6 #1297

Merged
merged 11 commits into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
],
"dependencies": {
"admin-config": "~0.12.1",
"angular": "~1.4.8",
"angular": "~1.6.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align angular-mocks version with this one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

"angular-numeraljs": "^1.1.6",
"angular-sanitize": "^1.3.15",
"angular-translate": "^2.11.0",
"angular-ui-bootstrap": "~1.2.1",
"angular-ui-codemirror": "jpetitcolas/ui-codemirror#di",
"angular-ui-router": "^0.2.14",
"angular-ui-router": "~0.4.0",
"bootstrap-sass": "^3.3.7",
"codemirror": "^5.2.0",
"core-js": "^0.6.1",
Expand Down Expand Up @@ -59,11 +59,13 @@
"html-loader": "^0.3.0",
"jasmine": "~2.4.1",
"jasmine-core": "~2.4.1",
"jasmine-spec-reporter": "^3.2.0",
"jshint-stylish": "~0.1.3",
"json-server": "~0.8.8",
"karma": "~0.13.21",
"karma-chrome-launcher": "~0.2.2",
"karma-jasmine": "~0.3.7",
"karma-mocha-reporter": "^2.2.1",
"karma-ng-html2js-preprocessor": "~0.2.1",
"karma-ng-scenario": "~0.1.0",
"karma-phantomjs-launcher": "~1.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/javascripts/ng-admin/Main/MainModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MainModule.directive('maMenuBar', require('./component/directive/maMenuBar'));
MainModule.config(require('./config/http'));
MainModule.config(require('./config/routing'));
MainModule.config(require('./config/translate'));
MainModule.config(require('./config/location'));

MainModule.run(require('./run/HttpErrorHandler'));
MainModule.run(require('./run/Loader'));
10 changes: 10 additions & 0 deletions src/javascripts/ng-admin/Main/config/location.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const location = ($locationProvider) => {
// Keep the start of all routes to #/ instead of #!/
// while updating to Angular 1.6
// @see https://docs.angularjs.org/guide/migration#commit-aa077e8
$locationProvider.hashPrefix('');
};

location.$inject = ['$locationProvider'];

export default location;
13 changes: 12 additions & 1 deletion src/javascripts/test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ module.exports = function (config) {
'test/function.bind.shim.js',
'test/unit/**/*.js'
],
plugins: ['karma-webpack', 'karma-jasmine', 'karma-chrome-launcher', 'karma-phantomjs-launcher'],
mochaReporter: {
showDiff: true,
ignoreSkipped: true,
},
reporters: ['mocha'],
plugins: [
'karma-webpack',
'karma-jasmine',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-mocha-reporter',
],
preprocessors: {
'ng-admin.js': 'webpack',
'test/**/*.js': 'webpack'
Expand Down
12 changes: 11 additions & 1 deletion src/javascripts/test/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*global browser*/
var jsonServer = require('json-server');
var path = require('path');
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;

var server = function() {
const server = jsonServer.create();
Expand All @@ -21,6 +22,14 @@ var beforeLaunch = function () {

var onPrepare = function () {
browser.executeScript('window.name = "NG_ENABLE_DEBUG_INFO"');
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
},
summary: {
displayDuration: false
}
}));
}

var afterLaunch = function () {
Expand Down Expand Up @@ -53,7 +62,8 @@ exports.config = {
isVerbose: true,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 360000
defaultTimeoutInterval: 360000,
print: () => {}, // Disable default reporter
},

beforeLaunch: beforeLaunch,
Expand Down
4 changes: 2 additions & 2 deletions src/javascripts/test/unit/Crud/field/maCheckboxFieldSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ describe('directive: checkbox-field', function () {
scope.value = true;
var element = $compile(directiveUsage)(scope);
scope.$digest();
expect(element.find('input').attr('checked')).toBeTruthy();
expect(element[0].querySelector(':checked')).toBeTruthy();
scope.value = false;
scope.$digest();
expect(element.find('input').attr('checked')).toBeFalsy();
expect(element[0].querySelector(':checked')).toBeFalsy();
});
});