mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36: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
|
@ -56,6 +56,22 @@ var helper = {};
|
|||
window.document.cookie = "";
|
||||
}
|
||||
|
||||
// Functionality for knowing what key event type is required for tests
|
||||
var evtType = "keydown";
|
||||
// if it's IE require keypress
|
||||
if(window.navigator.userAgent.indexOf("MSIE") > -1){
|
||||
evtType = "keypress";
|
||||
}
|
||||
// Edge also requires keypress.
|
||||
if(window.navigator.userAgent.indexOf("Edge") > -1){
|
||||
evtType = "keypress";
|
||||
}
|
||||
// Opera also requires keypress.
|
||||
if(window.navigator.userAgent.indexOf("OPR") > -1){
|
||||
evtType = "keypress";
|
||||
}
|
||||
helper.evtType = evtType;
|
||||
|
||||
helper.newPad = function(cb, padName){
|
||||
//build opts object
|
||||
var opts = {clearCookies: true}
|
||||
|
@ -216,4 +232,4 @@ var helper = {};
|
|||
|
||||
_it(name, func);
|
||||
}
|
||||
})()
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue