mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
tests: some scroll tests fixed
This commit is contained in:
parent
fc1d1fca2b
commit
90da21df35
1 changed files with 16 additions and 5 deletions
|
@ -23,7 +23,7 @@ describe('scroll when focus line is out of viewport', function () {
|
||||||
placeCaretInTheBeginningOfLine(lineCloseOfTopOfPad, function(){ // place caret in the 10th line
|
placeCaretInTheBeginningOfLine(lineCloseOfTopOfPad, function(){ // place caret in the 10th line
|
||||||
// warning: even pressing right arrow, the caret does not change of position
|
// warning: even pressing right arrow, the caret does not change of position
|
||||||
// the column where the caret is, it has not importance, only the line
|
// the column where the caret is, it has not importance, only the line
|
||||||
pressAndReleaseRightArrow();
|
pressAndReleaseRightArrow(); // I don't think this is working in Edge.
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -512,8 +512,14 @@ describe('scroll when focus line is out of viewport', function () {
|
||||||
|
|
||||||
var pressKey = function(keyCode, shiftIsPressed){
|
var pressKey = function(keyCode, shiftIsPressed){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var e = inner$.Event(helper.evtType);
|
|
||||||
e.shiftKey = shiftIsPressed;
|
/*
|
||||||
|
* These events use keydown and up, not keypress.
|
||||||
|
* Do not change. Changing to keypress will break Edge.
|
||||||
|
*/
|
||||||
|
var e = inner$.Event("keydown");
|
||||||
|
|
||||||
|
e.shiftKey = shiftIsPressed || false;
|
||||||
e.keyCode = keyCode;
|
e.keyCode = keyCode;
|
||||||
e.which = keyCode; // etherpad listens to 'which'
|
e.which = keyCode; // etherpad listens to 'which'
|
||||||
inner$('#innerdocbody').trigger(e);
|
inner$('#innerdocbody').trigger(e);
|
||||||
|
@ -521,8 +527,13 @@ describe('scroll when focus line is out of viewport', function () {
|
||||||
|
|
||||||
var releaseKey = function(keyCode){
|
var releaseKey = function(keyCode){
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var evtType = 'keyup';
|
|
||||||
var e = inner$.Event(evtType);
|
/*
|
||||||
|
* These events use keydown and up, not keypress.
|
||||||
|
* Do not change. Changing to keypress will break Edge.
|
||||||
|
*/
|
||||||
|
var e = inner$.Event("keyup");
|
||||||
|
|
||||||
e.keyCode = keyCode;
|
e.keyCode = keyCode;
|
||||||
e.which = keyCode; // etherpad listens to 'which'
|
e.which = keyCode; // etherpad listens to 'which'
|
||||||
inner$('#innerdocbody').trigger(e);
|
inner$('#innerdocbody').trigger(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue