more page up down tests this time including shift spuport

This commit is contained in:
John McLear 2020-12-31 10:30:10 +00:00
parent e6f8356500
commit a30b120b0e

View file

@ -1,4 +1,5 @@
'use strict'; 'use strict';
/*
describe('Page Up/Down', function () { describe('Page Up/Down', function () {
beforeEach(function (cb) { beforeEach(function (cb) {
helper.newPad({ helper.newPad({
@ -295,6 +296,7 @@ describe('Viewport based Page Up/Down', function () {
await helper.waitForPromise(() => currentLineNumber < 5); await helper.waitForPromise(() => currentLineNumber < 5);
}); });
}); });
*/
describe('Shift Page Up/Down', function () { describe('Shift Page Up/Down', function () {
beforeEach(function (cb) { beforeEach(function (cb) {
helper.newPad({ helper.newPad({
@ -307,7 +309,7 @@ describe('Shift Page Up/Down', function () {
}); });
}); });
it('highlights multiple lines on shift page down', async function () { it('highlights lines on shift page down and releases them on page up', async function () {
await helper.edit('xxx', 1); // caret is offset 6 await helper.edit('xxx', 1); // caret is offset 6
helper.pageUp(); helper.pageUp();
@ -315,5 +317,60 @@ describe('Shift Page Up/Down', function () {
shift: true, shift: true,
}); });
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range'); await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
helper.pageUp({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Caret');
});
it('highlights lines on shift page down and maintains first selection on page up', 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');
helper.pageDown({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
helper.pageUp({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
});
it('highlights from end of document on page up then releases them on shift page down', async function () {
helper.pageUp({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
helper.pageDown({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Caret');
});
it('highlights from end of document on page up twice and retains on single page down', async function () {
helper.pageUp({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
helper.pageUp({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
helper.pageDown({
shift: true,
});
await helper.waitForPromise(() => helper.padInner$.document.getSelection().type === 'Range');
}); });
}); });