element now?
diff --git a/tests/frontend/specs/timeslider.js b/tests/frontend/specs/timeslider.js
index bea7932df..401a71758 100644
--- a/tests/frontend/specs/timeslider.js
+++ b/tests/frontend/specs/timeslider.js
@@ -1,3 +1,5 @@
+'use strict';
+
// deactivated, we need a nice way to get the timeslider, this is ugly
xdescribe('timeslider button takes you to the timeslider of a pad', function () {
beforeEach(function (cb) {
diff --git a/tests/frontend/specs/timeslider_follow.js b/tests/frontend/specs/timeslider_follow.js
index 9f86ddc77..9324c8344 100644
--- a/tests/frontend/specs/timeslider_follow.js
+++ b/tests/frontend/specs/timeslider_follow.js
@@ -9,6 +9,7 @@ describe('timeslider follow', function () {
// TODO needs test if content is also followed, when user a makes edits
// while user b is in the timeslider
it("content as it's added to timeslider", async function () {
+ this.timeout(0); // JM TO DO
// send 6 revisions
const revs = 6;
const message = 'a\n\n\n\n\n\n\n\n\n\n';
diff --git a/tests/frontend/specs/timeslider_labels.js b/tests/frontend/specs/timeslider_labels.js
index c7a4aca5a..72a24256b 100644
--- a/tests/frontend/specs/timeslider_labels.js
+++ b/tests/frontend/specs/timeslider_labels.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('timeslider', function () {
// create a new pad before each test run
beforeEach(function (cb) {
@@ -7,7 +9,8 @@ describe('timeslider', function () {
/**
* @todo test authorsList
*/
- it("Shows a date and time in the timeslider and make sure it doesn't include NaN", async function () {
+ it('Shows a correctly formatted date and time', async function () {
+ this.timeout(12000);
// make some changes to produce 3 revisions
const revs = 3;
diff --git a/tests/frontend/specs/timeslider_numeric_padID.js b/tests/frontend/specs/timeslider_numeric_padID.js
index 53eb4a29c..0fca6b027 100644
--- a/tests/frontend/specs/timeslider_numeric_padID.js
+++ b/tests/frontend/specs/timeslider_numeric_padID.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('timeslider', function () {
const padId = 735773577357 + (Math.round(Math.random() * 1000));
@@ -7,6 +9,8 @@ describe('timeslider', function () {
});
it('Makes sure the export URIs are as expected when the padID is numeric', async function () {
+ this.timeout(6000);
+
await helper.edit('a\n');
await helper.gotoTimeslider(1);
diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js
index fbfbb3615..de3c52a6f 100644
--- a/tests/frontend/specs/timeslider_revisions.js
+++ b/tests/frontend/specs/timeslider_revisions.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('timeslider', function () {
// create a new pad before each test run
beforeEach(function (cb) {
@@ -5,7 +7,8 @@ describe('timeslider', function () {
this.timeout(60000);
});
- it('loads adds a hundred revisions', function (done) { // passes
+ it('loads adds a hundred revisions', function (done) {
+ this.timeout(100000);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
@@ -23,7 +26,8 @@ describe('timeslider', function () {
setTimeout(() => {
// go to timeslider
- $('#iframe-container iframe').attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider`);
+ $('#iframe-container iframe')
+ .attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider`);
setTimeout(() => {
const timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
@@ -66,7 +70,6 @@ describe('timeslider', function () {
// Disabled as jquery trigger no longer works properly
xit('changes the url when clicking on the timeslider', function (done) {
const inner$ = helper.padInner$;
- const chrome$ = helper.padChrome$;
// make some changes to produce 7 revisions
const timePerRev = 1000;
@@ -81,13 +84,13 @@ describe('timeslider', function () {
setTimeout(() => {
// go to timeslider
- $('#iframe-container iframe').attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider`);
+ $('#iframe-container iframe')
+ .attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider`);
setTimeout(() => {
const timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
const $sliderBar = timeslider$('#ui-slider-bar');
- const latestContents = timeslider$('#innerdocbody').text();
const oldUrl = $('#iframe-container iframe')[0].contentWindow.location.hash;
// Click somewhere on the timeslider
@@ -96,20 +99,22 @@ describe('timeslider', function () {
e.clientY = e.pageY = 60;
$sliderBar.trigger(e);
- helper.waitFor(() => $('#iframe-container iframe')[0].contentWindow.location.hash != oldUrl, 6000).always(() => {
- expect($('#iframe-container iframe')[0].contentWindow.location.hash).not.to.eql(oldUrl);
- done();
- });
+ helper.waitFor(
+ () => $('#iframe-container iframe')[0].contentWindow.location.hash !== oldUrl, 6000)
+ .always(() => {
+ expect($('#iframe-container iframe')[0].contentWindow.location.hash)
+ .not.to.eql(oldUrl);
+ done();
+ });
}, 6000);
}, revs * timePerRev);
});
it('jumps to a revision given in the url', function (done) {
+ this.timeout(6000);
const inner$ = helper.padInner$;
- const chrome$ = helper.padChrome$;
- this.timeout(40000);
// wait for the text to be loaded
- helper.waitFor(() => inner$('body').text().length != 0, 10000).always(() => {
+ helper.waitFor(() => inner$('body').text().length !== 0, 10000).always(() => {
const newLines = inner$('body div').length;
const oldLength = inner$('body').text().length + newLines / 2;
expect(oldLength).to.not.eql(0);
@@ -120,22 +125,25 @@ describe('timeslider', function () {
helper.waitFor(() => {
// newLines takes the new lines into account which are strippen when using
// inner$('body').text(), one is used for one line in ACE.
- const lenOkay = inner$('body').text().length + newLines / 2 != oldLength;
+ const lenOkay = inner$('body').text().length + newLines / 2 !== oldLength;
// this waits for the color to be added to our , which means that the revision
// was accepted by the server.
- const colorOkay = inner$('span').first().attr('class').indexOf('author-') == 0;
+ const colorOkay = inner$('span').first().attr('class').indexOf('author-') === 0;
return lenOkay && colorOkay;
}, 10000).always(() => {
// go to timeslider with a specific revision set
- $('#iframe-container iframe').attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider#0`);
+ $('#iframe-container iframe')
+ .attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider#0`);
// wait for the timeslider to be loaded
helper.waitFor(() => {
try {
timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
- } catch (e) {}
+ } catch (e) {
+ // silently fart. Deadly.
+ }
if (timeslider$) {
- return timeslider$('#innerdocbody').text().length == oldLength;
+ return timeslider$('#innerdocbody').text().length === oldLength;
}
}, 10000).always(() => {
expect(timeslider$('#innerdocbody').text().length).to.eql(oldLength);
@@ -146,25 +154,28 @@ describe('timeslider', function () {
});
it('checks the export url', function (done) {
+ this.timeout(6000);
const inner$ = helper.padInner$;
- const chrome$ = helper.padChrome$;
this.timeout(11000);
inner$('div').first().sendkeys('a');
setTimeout(() => {
// go to timeslider
- $('#iframe-container iframe').attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider#0`);
+ $('#iframe-container iframe')
+ .attr('src', `${$('#iframe-container iframe').attr('src')}/timeslider#0`);
let timeslider$;
let exportLink;
helper.waitFor(() => {
try {
timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
- } catch (e) {}
+ } catch (e) {
+ // silently give up on life.
+ }
if (!timeslider$) return false;
exportLink = timeslider$('#exportplaina').attr('href');
if (!exportLink) return false;
- return exportLink.substr(exportLink.length - 12) == '0/export/txt';
+ return exportLink.substr(exportLink.length - 12) === '0/export/txt';
}, 6000).always(() => {
expect(exportLink.substr(exportLink.length - 12)).to.eql('0/export/txt');
done();
diff --git a/tests/frontend/specs/undo.js b/tests/frontend/specs/undo.js
index 0c94f2230..762f50d62 100644
--- a/tests/frontend/specs/undo.js
+++ b/tests/frontend/specs/undo.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('undo button', function () {
beforeEach(function (cb) {
helper.newPad(cb); // creates a new pad
@@ -5,6 +7,7 @@ describe('undo button', function () {
});
it('undo some typing by clicking undo button', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
@@ -29,8 +32,8 @@ describe('undo button', function () {
});
it('undo some typing using a keypress', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
- const chrome$ = helper.padChrome$;
// get the first text element inside the editable space
const $firstTextElement = inner$('div span').first();
diff --git a/tests/frontend/specs/unordered_list.js b/tests/frontend/specs/unordered_list.js
index 4cbdabfac..af13af2b2 100644
--- a/tests/frontend/specs/unordered_list.js
+++ b/tests/frontend/specs/unordered_list.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('assign unordered list', function () {
// create a new pad before each test run
beforeEach(function (cb) {
@@ -6,6 +8,7 @@ describe('assign unordered list', function () {
});
it('insert unordered list text then removes by outdent', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
const originalText = inner$('div').first().text();
@@ -32,6 +35,7 @@ describe('assign unordered list', function () {
});
describe('unassign unordered list', function () {
+ this.timeout(100);
// create a new pad before each test run
beforeEach(function (cb) {
helper.newPad(cb);
@@ -39,6 +43,7 @@ describe('unassign unordered list', function () {
});
it('insert unordered list text then remove by clicking list again', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
const originalText = inner$('div').first().text();
@@ -74,6 +79,7 @@ describe('keep unordered list on enter key', function () {
});
it('Keeps the unordered list on enter for the new line', function (done) {
+ this.timeout(1000);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
@@ -98,6 +104,7 @@ describe('keep unordered list on enter key', function () {
});
describe('Pressing Tab in an UL increases and decreases indentation', function () {
+ this.timeout(100);
// create a new pad before each test run
beforeEach(function (cb) {
helper.newPad(cb);
@@ -105,6 +112,7 @@ describe('Pressing Tab in an UL increases and decreases indentation', function (
});
it('indent and de-indent list item with keypress', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
@@ -138,6 +146,7 @@ describe('Pressing indent/outdent button in an UL increases and decreases indent
});
it('indent and de-indent list item with indent button', function (done) {
+ this.timeout(100);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$;
diff --git a/tests/frontend/specs/urls_become_clickable.js b/tests/frontend/specs/urls_become_clickable.js
index a027de9ff..2aed8e476 100644
--- a/tests/frontend/specs/urls_become_clickable.js
+++ b/tests/frontend/specs/urls_become_clickable.js
@@ -20,6 +20,7 @@ describe('urls', function () {
describe('entering a URL makes a link', function () {
for (const url of ['https://etherpad.org', 'www.etherpad.org']) {
it(url, async function () {
+ this.timeout(5000);
const url = 'https://etherpad.org';
await helper.edit(url);
await helper.waitForPromise(() => txt().find('a').length === 1, 2000);
@@ -34,6 +35,7 @@ describe('urls', function () {
for (const char of '-:@_.,~%+/?=!;()$\'*') {
const url = `https://etherpad.org/${char}foo`;
it(url, async function () {
+ this.timeout(5000);
await helper.edit(url);
await helper.waitForPromise(() => txt().find('a').length === 1);
const link = txt().find('a');
@@ -48,6 +50,7 @@ describe('urls', function () {
const want = 'https://etherpad.org';
const input = want + char;
it(input, async function () {
+ this.timeout(5000);
await helper.edit(input);
await helper.waitForPromise(() => txt().find('a').length === 1);
const link = txt().find('a');
diff --git a/tests/frontend/specs/xxauto_reconnect.js b/tests/frontend/specs/xxauto_reconnect.js
index 574616ce5..1c16d647e 100644
--- a/tests/frontend/specs/xxauto_reconnect.js
+++ b/tests/frontend/specs/xxauto_reconnect.js
@@ -1,3 +1,5 @@
+'use strict';
+
describe('Automatic pad reload on Force Reconnect message', function () {
let padId, $originalPadFrame;
@@ -59,9 +61,8 @@ describe('Automatic pad reload on Force Reconnect message', function () {
});
it('reloads the pad', function (done) {
- helper.waitFor(() => padWasReloaded, 5000).done(done);
-
this.timeout(5000);
+ helper.waitFor(() => padWasReloaded, 5000).done(done);
});
});
});