unit testing - Test keydown event in AngularJS with Jasmine and PhantomJS -
i tried implement solution here function, doesn't work, everytime have oevent.keycode = 0
in unit tests keydown event triggered, can't test if specific key pressed.
solution:
worked me phantomjs 1.9.8
function simulatekeydownevent(element, keycode) { var event = document.createevent("events"); event.initevent("keydown", true, true); event.keycode = keycode; element.dispatchevent(event); }
Comments
Post a Comment