lint: Fix some straightforward ESLint errors

This commit is contained in:
Richard Hansen 2020-12-13 18:34:11 -05:00 committed by John McLear
parent e66e8a4eb2
commit ca01856f94
3 changed files with 139 additions and 113 deletions

View file

@ -1,3 +1,5 @@
'use strict';
/**
* Spys on socket.io messages and saves them into several arrays
* that are visible in tests

View file

@ -1,3 +1,5 @@
'use strict';
describe('timeslider follow', function () {
// create a new pad before each test run
beforeEach(function (cb) {
@ -23,7 +25,7 @@ describe('timeslider follow', function () {
helper.contentWindow().$('#playpause_button_icon').click();
let newTop;
return helper.waitForPromise(() => {
await helper.waitForPromise(() => {
newTop = helper.contentWindow().$('#innerdocbody').offset();
return newTop.top < originalTop.top;
});
@ -96,9 +98,9 @@ describe('timeslider follow', function () {
* @param {number} lineNum
* @returns {boolean} scrolled to the lineOffset?
*/
function hasFollowedToLine(lineNum) {
const hasFollowedToLine = (lineNum) => {
const scrollPosition = helper.contentWindow().$('#editorcontainerbox')[0].scrollTop;
const lineOffset = helper.contentWindow().$('#innerdocbody').find(`div:nth-child(${lineNum})`)[0].offsetTop;
const lineOffset =
helper.contentWindow().$('#innerdocbody').find(`div:nth-child(${lineNum})`)[0].offsetTop;
return Math.abs(scrollPosition - lineOffset) < 1;
}
};