Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #14 from kasperlewau/fix/broken-phantom-tests
Browse files Browse the repository at this point in the history
Fix/broken phantom tests
  • Loading branch information
ProLoser committed Oct 19, 2015
2 parents 1f4ad41 + 477e52d commit d7203c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ module.exports = function(config) {
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/phantomjs-polyfill/bind-polyfill.js',
'src/**/*.js',
'test/**/*.js'
'test/**/*.spec.js'
],
preprocessors: {
'src/**/*.js': 'babel',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"karma-phantomjs-launcher": "^0.2.1",
"mocha": "^2.2.5",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"sinon-chai": "^2.8.0"
}
}
10 changes: 3 additions & 7 deletions test/uiMentionController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,9 @@ describe('uiMentionController', () => {
function trigger (el, ev, code) {
let evt;

if (code) {
evt = $document[0].createEvent('KeyboardEvent');
evt.initKeyboardEvent(ev, true, true);
evt.keyCode = code;
} else {
evt = new Event(ev);
}
evt = $document[0].createEvent('KeyboardEvent');
evt.initKeyboardEvent(ev, true, true);
evt.keyCode = code;

el[0].dispatchEvent(evt);

Expand Down

0 comments on commit d7203c8

Please sign in to comment.