mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
tests: sendkeys: Fix {enter}
keypress event
This commit is contained in:
parent
c6f643dd75
commit
ce5ef9350f
2 changed files with 2 additions and 3 deletions
|
@ -426,8 +426,8 @@ $.fn.sendkeys.defaults = {
|
||||||
'{enter}': function (rng){
|
'{enter}': function (rng){
|
||||||
rng.insertEOL();
|
rng.insertEOL();
|
||||||
rng.select();
|
rng.select();
|
||||||
var x = '\n'.charCodeAt(0);
|
$(rng._el).trigger(
|
||||||
$(rng._el).trigger({type: 'keypress', keyCode: x, which: x, charCode: x});
|
{type: 'keypress', keyCode: 13, which: 13, charCode: 13, code: 'Enter', key: 'Enter'});
|
||||||
},
|
},
|
||||||
'{backspace}': function (rng){
|
'{backspace}': function (rng){
|
||||||
var b = rng.bounds();
|
var b = rng.bounds();
|
||||||
|
|
|
@ -89,7 +89,6 @@ describe('change user color', function () {
|
||||||
$chatButton.click();
|
$chatButton.click();
|
||||||
const $chatInput = chrome$('#chatinput');
|
const $chatInput = chrome$('#chatinput');
|
||||||
$chatInput.sendkeys('O hi'); // simulate a keypress of typing user
|
$chatInput.sendkeys('O hi'); // simulate a keypress of typing user
|
||||||
// simulate a keypress of enter actually does evt.which = 10 not 13
|
|
||||||
$chatInput.sendkeys('{enter}');
|
$chatInput.sendkeys('{enter}');
|
||||||
|
|
||||||
// wait until the chat message shows up
|
// wait until the chat message shows up
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue