mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
lint: Fix some straightforward ESLint errors
This commit is contained in:
parent
e66e8a4eb2
commit
ca01856f94
3 changed files with 139 additions and 113 deletions
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Spys on socket.io messages and saves them into several arrays
|
||||
* that are visible in tests
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue