mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 09:26:14 -04:00
tests: use helper for evttype to reduce duplicate code
This commit is contained in:
parent
be9afc7955
commit
675c839d92
10 changed files with 27 additions and 117 deletions
|
@ -15,18 +15,7 @@ describe("indentation button", function(){
|
|||
//select this text element
|
||||
$firstTextElement.sendkeys('{selectall}');
|
||||
|
||||
if(inner$(window)[0].bowser.modernIE){ // if it's IE
|
||||
var evtType = "keypress";
|
||||
}else{
|
||||
// Edge also requires keypress.
|
||||
if(window.navigator.userAgent.indexOf("Edge") > -1){
|
||||
var evtType = "keypress";
|
||||
}else{
|
||||
var evtType = "keydown";
|
||||
}
|
||||
}
|
||||
|
||||
var e = inner$.Event(evtType);
|
||||
var e = inner$.Event(helper.evtType);
|
||||
e.keyCode = 9; // tab :|
|
||||
inner$("#innerdocbody").trigger(e);
|
||||
|
||||
|
@ -330,12 +319,7 @@ describe("indentation button", function(){
|
|||
|
||||
function pressEnter(){
|
||||
var inner$ = helper.padInner$;
|
||||
if(inner$(window)[0].bowser.modernIE){ // if it's IE
|
||||
var evtType = "keypress";
|
||||
}else{
|
||||
var evtType = "keydown";
|
||||
}
|
||||
var e = inner$.Event(evtType);
|
||||
var e = inner$.Event(helper.evtType);
|
||||
e.keyCode = 13; // enter :|
|
||||
inner$("#innerdocbody").trigger(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue