include opts in pageup/pagedown method to support shift key and include the test

This commit is contained in:
John McLear 2020-12-30 19:19:35 +00:00
parent dda5e03f7e
commit 5a425d7e69
2 changed files with 41 additions and 6 deletions

View file

@ -1,4 +1,5 @@
'use strict';
/*
describe('Page Up/Down', function () {
beforeEach(function (cb) {
helper.newPad({
@ -268,7 +269,7 @@ describe('Really long text line goes to character within text line if text line
});
});
describe('Viewport baesd Page Up/Down', function () {
describe('Viewport based Page Up/Down', function () {
beforeEach(function (cb) {
helper.newPad({
cb: async () => {
@ -295,3 +296,26 @@ describe('Viewport baesd Page Up/Down', function () {
await helper.waitForPromise(() => currentLineNumber < 5);
});
});
*/
describe('Shift Page Up/Down', function () {
beforeEach(function (cb) {
helper.newPad({
cb: async () => {
await helper.clearPad();
// 200 lines
await helper.edit('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n');
cb();
},
});
});
it('highlights multiple lines on shift page down', async function () {
await helper.edit('xxx', 1); // caret is offset 6
helper.pageUp();
helper.pageDown({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
});
});