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

Fix/broken phantom tests #14

Merged
merged 2 commits into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all 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
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