mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 03:16:16 -04:00
simulate real keypress event
This commit is contained in:
parent
536a6dce70
commit
bd58fd15d4
1 changed files with 6 additions and 1 deletions
|
@ -17,7 +17,12 @@ describe("All the alphabet works n stuff", function(){
|
||||||
// simulate key presses to delete content
|
// simulate key presses to delete content
|
||||||
firstTextElement.sendkeys('{selectall}'); // select all
|
firstTextElement.sendkeys('{selectall}'); // select all
|
||||||
firstTextElement.sendkeys('{del}'); // clear the first line
|
firstTextElement.sendkeys('{del}'); // clear the first line
|
||||||
firstTextElement.sendkeys(expectedString); // insert the string
|
|
||||||
|
let code;
|
||||||
|
for (let index = 0; index < expectedString.length; index++){
|
||||||
|
code = expectedString.charCodeAt(index);
|
||||||
|
$(firstTextElement).trigger({type: 'keypress', which: code, keyCode: code, ctrlKey: false});
|
||||||
|
}
|
||||||
|
|
||||||
helper.waitFor(function(){
|
helper.waitFor(function(){
|
||||||
return inner$("div").first().text() === expectedString;
|
return inner$("div").first().text() === expectedString;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue