From 2f0860864960e2906c6fa74789c54fd79b05d6ea Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 8 Jan 2021 21:25:01 +0000 Subject: [PATCH] up movement test --- tests/frontend/specs/pageupdownlongline.js | 216 +++++++++++++++------ 1 file changed, 157 insertions(+), 59 deletions(-) diff --git a/tests/frontend/specs/pageupdownlongline.js b/tests/frontend/specs/pageupdownlongline.js index 958673244..d18149533 100755 --- a/tests/frontend/specs/pageupdownlongline.js +++ b/tests/frontend/specs/pageupdownlongline.js @@ -9,59 +9,139 @@ describe(`Really long text line goes to character within text line if text line // 200 lines await helper.edit( 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world\n ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - 'hello world hello world hello world hello world hello world hello world hello world ' + - '\n\n\n\n\n\n\n\n\n '); + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + ' \n ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + '\n\n\n\n\n\n\n\n\n ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world ' + + 'hello world hello world hello world hello world hello world hello world hello world '); cb(); }, }); @@ -84,12 +164,30 @@ describe(`Really long text line goes to character within text line if text line return true; } }); + let previousLineNumber; + + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + helper.pageDown(); + await helper.waitForPromise(() => helper.caretLineNumber() >= previousLineNumber); + previousLineNumber = helper.caretLineNumber(); + + // we're at the bottom.. helper.pageUp(); - await helper.waitForPromise(() => { - if ((helper.padInner$.document.getSelection().anchorOffset > 0) && - (helper.caretLineNumber() === 1)) { - return true; - } - }); + // goes up within line but not pad + await helper.waitForPromise(() => helper.caretLineNumber() === previousLineNumber); }); });