tests: hopefully fixed all tests to be working in edge

This commit is contained in:
John McLear 2020-03-22 18:19:29 +00:00 committed by muxator
parent 4eec68fbdd
commit 58e1e2d16f
8 changed files with 56 additions and 12 deletions

View file

@ -513,11 +513,18 @@ describe('scroll when focus line is out of viewport', function () {
var pressKey = function(keyCode, shiftIsPressed){
var inner$ = helper.padInner$;
var evtType;
if(inner$(window)[0].bowser.modernIE){ // if it's IE
evtType = 'keypress';
var evtType = "keypress";
}else{
evtType = 'keydown';
// Edge also requires keypress.
if(window.navigator.userAgent.indexOf("Edge") > -1){
var evtType = "keypress";
}else{
var evtType = "keydown";
}
}
var e = inner$.Event(evtType);
e.shiftKey = shiftIsPressed;
e.keyCode = keyCode;