lint and timeouts for sessionAndGroups.js
parent
3d69773cd2
commit
6f364b065d
|
@ -1,3 +1,5 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
||||||
|
@ -14,6 +16,7 @@ let padID = makeid();
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
describe('API Versioning', function () {
|
describe('API Versioning', function () {
|
||||||
it('errors if can not connect', async function () {
|
it('errors if can not connect', async function () {
|
||||||
|
this.timeout(200);
|
||||||
await api.get('/api/')
|
await api.get('/api/')
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect((res) => {
|
.expect((res) => {
|
||||||
|
@ -55,6 +58,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Group creation and deletion', function () {
|
describe('API: Group creation and deletion', function () {
|
||||||
it('createGroup', async function () {
|
it('createGroup', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(endPoint('createGroup'))
|
await api.get(endPoint('createGroup'))
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -66,6 +70,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('listSessionsOfGroup for empty group', async function () {
|
it('listSessionsOfGroup for empty group', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('listSessionsOfGroup')}&groupID=${groupID}`)
|
await api.get(`${endPoint('listSessionsOfGroup')}&groupID=${groupID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -76,6 +81,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('deleteGroup', async function () {
|
it('deleteGroup', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('deleteGroup')}&groupID=${groupID}`)
|
await api.get(`${endPoint('deleteGroup')}&groupID=${groupID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -85,6 +91,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('createGroupIfNotExistsFor', async function () {
|
it('createGroupIfNotExistsFor', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('createGroupIfNotExistsFor')}&groupMapper=management`)
|
await api.get(`${endPoint('createGroupIfNotExistsFor')}&groupMapper=management`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -97,6 +104,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Author creation', function () {
|
describe('API: Author creation', function () {
|
||||||
it('createGroup', async function () {
|
it('createGroup', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(endPoint('createGroup'))
|
await api.get(endPoint('createGroup'))
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -108,6 +116,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('createAuthor', async function () {
|
it('createAuthor', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(endPoint('createAuthor'))
|
await api.get(endPoint('createAuthor'))
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -118,6 +127,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('createAuthor with name', async function () {
|
it('createAuthor with name', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('createAuthor')}&name=john`)
|
await api.get(`${endPoint('createAuthor')}&name=john`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -129,6 +139,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('createAuthorIfNotExistsFor', async function () {
|
it('createAuthorIfNotExistsFor', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('createAuthorIfNotExistsFor')}&authorMapper=chris`)
|
await api.get(`${endPoint('createAuthorIfNotExistsFor')}&authorMapper=chris`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -139,6 +150,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getAuthorName', async function () {
|
it('getAuthorName', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('getAuthorName')}&authorID=${authorID}`)
|
await api.get(`${endPoint('getAuthorName')}&authorID=${authorID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -151,6 +163,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Sessions', function () {
|
describe('API: Sessions', function () {
|
||||||
it('createSession', async function () {
|
it('createSession', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('createSession')
|
await api.get(`${endPoint('createSession')
|
||||||
}&authorID=${authorID}&groupID=${groupID}&validUntil=999999999999`)
|
}&authorID=${authorID}&groupID=${groupID}&validUntil=999999999999`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
|
@ -163,6 +176,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getSessionInfo', async function () {
|
it('getSessionInfo', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('getSessionInfo')}&sessionID=${sessionID}`)
|
await api.get(`${endPoint('getSessionInfo')}&sessionID=${sessionID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -175,6 +189,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('listSessionsOfGroup', async function () {
|
it('listSessionsOfGroup', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('listSessionsOfGroup')}&groupID=${groupID}`)
|
await api.get(`${endPoint('listSessionsOfGroup')}&groupID=${groupID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -185,6 +200,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('deleteSession', async function () {
|
it('deleteSession', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('deleteSession')}&sessionID=${sessionID}`)
|
await api.get(`${endPoint('deleteSession')}&sessionID=${sessionID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -194,6 +210,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getSessionInfo of deleted session', async function () {
|
it('getSessionInfo of deleted session', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('getSessionInfo')}&sessionID=${sessionID}`)
|
await api.get(`${endPoint('getSessionInfo')}&sessionID=${sessionID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -205,6 +222,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Group pad management', function () {
|
describe('API: Group pad management', function () {
|
||||||
it('listPads', async function () {
|
it('listPads', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('listPads')}&groupID=${groupID}`)
|
await api.get(`${endPoint('listPads')}&groupID=${groupID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -215,6 +233,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('createGroupPad', async function () {
|
it('createGroupPad', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('createGroupPad')}&groupID=${groupID}&padName=${padID}`)
|
await api.get(`${endPoint('createGroupPad')}&groupID=${groupID}&padName=${padID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -225,6 +244,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('listPads after creating a group pad', async function () {
|
it('listPads after creating a group pad', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('listPads')}&groupID=${groupID}`)
|
await api.get(`${endPoint('listPads')}&groupID=${groupID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -237,6 +257,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Pad security', function () {
|
describe('API: Pad security', function () {
|
||||||
it('getPublicStatus', async function () {
|
it('getPublicStatus', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('getPublicStatus')}&padID=${padID}`)
|
await api.get(`${endPoint('getPublicStatus')}&padID=${padID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -247,6 +268,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('setPublicStatus', async function () {
|
it('setPublicStatus', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('setPublicStatus')}&padID=${padID}&publicStatus=true`)
|
await api.get(`${endPoint('setPublicStatus')}&padID=${padID}&publicStatus=true`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -256,6 +278,7 @@ describe(__filename, function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getPublicStatus after changing public status', async function () {
|
it('getPublicStatus after changing public status', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('getPublicStatus')}&padID=${padID}`)
|
await api.get(`${endPoint('getPublicStatus')}&padID=${padID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
@ -272,6 +295,7 @@ describe(__filename, function () {
|
||||||
|
|
||||||
describe('API: Misc', function () {
|
describe('API: Misc', function () {
|
||||||
it('listPadsOfAuthor', async function () {
|
it('listPadsOfAuthor', async function () {
|
||||||
|
this.timeout(100);
|
||||||
await api.get(`${endPoint('listPadsOfAuthor')}&authorID=${authorID}`)
|
await api.get(`${endPoint('listPadsOfAuthor')}&authorID=${authorID}`)
|
||||||
.expect(200)
|
.expect(200)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
|
Loading…
Reference in New Issue