From f4eeb59b86937db2e3990a9d796c7411c0b5dd10 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 27 Jan 2021 20:29:14 +0000 Subject: [PATCH] line and timeouts for characterEncoding.js --- tests/backend/specs/api/characterEncoding.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/backend/specs/api/characterEncoding.js b/tests/backend/specs/api/characterEncoding.js index 94c22307d..f8b78ca04 100644 --- a/tests/backend/specs/api/characterEncoding.js +++ b/tests/backend/specs/api/characterEncoding.js @@ -19,6 +19,7 @@ const testPadId = makeid(); describe(__filename, function () { describe('Connectivity For Character Encoding', function () { it('can connect', function (done) { + this.timeout(250); api.get('/api/') .expect('Content-Type', /json/) .expect(200, done); @@ -27,6 +28,7 @@ describe(__filename, function () { describe('API Versioning', function () { it('finds the version tag', function (done) { + this.timeout(150); api.get('/api/') .expect((res) => { apiVersion = res.body.currentVersion; @@ -39,6 +41,7 @@ describe(__filename, function () { describe('Permission', function () { it('errors with invalid APIKey', function (done) { + this.timeout(150); // This is broken because Etherpad doesn't handle HTTP codes properly see #2343 // If your APIKey is password you deserve to fail all tests anyway const permErrorURL = `/api/${apiVersion}/createPad?apikey=password&padID=test`; @@ -49,6 +52,7 @@ describe(__filename, function () { describe('createPad', function () { it('creates a new Pad', function (done) { + this.timeout(150); api.get(`${endPoint('createPad')}&padID=${testPadId}`) .expect((res) => { if (res.body.code !== 0) throw new Error('Unable to create new Pad'); @@ -60,6 +64,7 @@ describe(__filename, function () { describe('setHTML', function () { it('Sets the HTML of a Pad attempting to weird utf8 encoded content', function (done) { + this.timeout(150); fs.readFile('../tests/backend/specs/api/emojis.html', 'utf8', (err, html) => { api.post(endPoint('setHTML')) .send({ @@ -77,6 +82,7 @@ describe(__filename, function () { describe('getHTML', function () { it('get the HTML of Pad with emojis', function (done) { + this.timeout(150); api.get(`${endPoint('getHTML')}&padID=${testPadId}`) .expect((res) => { if (res.body.data.html.indexOf('🇼') === -1) { @@ -95,7 +101,7 @@ describe(__filename, function () { */ -var endPoint = function (point, version) { +const endPoint = function (point, version) { version = version || apiVersion; return `/api/${version}/${point}?apikey=${apiKey}`; };