lint: Fix bugs and style issues introduced in PR #4718

This fixes issues introduced in commit
f8a19c4527.
This commit is contained in:
Richard Hansen 2021-02-07 01:57:37 -05:00 committed by John McLear
parent 0ff8274d2e
commit 294f2a251f
6 changed files with 165 additions and 179 deletions

View file

@ -1,25 +1,24 @@
'use strict';
describe('scrolls to line', function () {
// create a new pad with URL hash set before each test run
before(async function () {
this.timeout(60000);
await new Promise((resolve, reject) => helper.newPad({
cb: (err) => {
if (err != null) return reject(err);
resolve();
},
hash: 'L4',
}));
});
describe('scrollTo.js', function () {
describe('scrolls to line', function () {
// create a new pad with URL hash set before each test run
before(async function () {
this.timeout(60000);
await new Promise((resolve, reject) => helper.newPad({
cb: (err) => (err != null) ? reject(err) : resolve(),
hash: 'L4',
}));
});
it('Scrolls down to Line 4', async function () {
this.timeout(10000);
const chrome$ = helper.padChrome$;
await helper.waitForPromise(() => {
const topOffset = parseInt(chrome$('iframe').first('iframe')
.contents().find('#outerdocbody').css('top'));
return (topOffset >= 100);
it('Scrolls down to Line 4', async function () {
this.timeout(10000);
const chrome$ = helper.padChrome$;
await helper.waitForPromise(() => {
const topOffset = parseInt(chrome$('iframe').first('iframe')
.contents().find('#outerdocbody').css('top'));
return (topOffset >= 100);
});
});
});
@ -28,10 +27,7 @@ describe('scrolls to line', function () {
before(async function () {
this.timeout(60000);
await new Promise((resolve, reject) => helper.newPad({
cb: (err) => {
if (err != null) return reject(err);
resolve();
},
cb: (err) => (err != null) ? reject(err) : resolve(),
hash: '#DEEZ123123NUTS',
}));
});