lint: lint and various fixes of frontend test specs

This commit is contained in:
John McLear 2021-02-07 06:39:03 +00:00 committed by GitHub
parent da10d42183
commit f8a19c4527
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 261 additions and 240 deletions

View file

@ -2,12 +2,15 @@
describe('scrolls to line', function () {
// create a new pad with URL hash set before each test run
beforeEach(function (cb) {
helper.newPad({
before(async function () {
this.timeout(60000);
await new Promise((resolve, reject) => helper.newPad({
cb: (err) => {
if (err != null) return reject(err);
resolve();
},
hash: 'L4',
cb,
});
this.timeout(10000);
}));
});
it('Scrolls down to Line 4', async function () {
@ -19,25 +22,28 @@ describe('scrolls to line', function () {
return (topOffset >= 100);
});
});
});
describe('doesnt break on weird hash input', function () {
// create a new pad with URL hash set before each test run
beforeEach(function (cb) {
helper.newPad({
hash: '#DEEZ123123NUTS',
cb,
describe('doesnt break on weird hash input', 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: '#DEEZ123123NUTS',
}));
});
this.timeout(10000);
});
it('Does NOT change scroll', 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); // no css top should be set.
it('Does NOT change scroll', 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); // no css top should be set.
});
});
});
});