Improve experience and add test

- Scroll to bottom on keydown (when scrolled up)
- Add test to ensure above behavior
This commit is contained in:
Paris Kasidiaris
2016-11-04 12:29:17 +00:00
parent 5e68acfc76
commit 0de3d839e6
2 changed files with 25 additions and 7 deletions
+19
View File
@@ -181,6 +181,25 @@ describe('xterm.js', function() {
assert.equal(xterm.ydisp, startYDisp);
});
});
describe('keyDown', function () {
it('should scroll down, when a key is pressed and terminal is scrolled up', function () {
var terminal = new Terminal();
// Do not process the keyDown event, to avoid side-effects
terminal.attachCustomKeydownHandler(function () {
return false;
});
terminal.ydisp = 0;
terminal.ybase = 40;
terminal.keyDown();
// Ensure that now the terminal is scrolled to bottom
assert.equal(terminal.ydisp, terminal.ybase);
});
});
});
describe('evaluateKeyEscapeSequence', function() {