-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
- createUser, flushTests, killallServers, makeDeleteRequest, makePostBodyRequest, flushAndRunServer, ServerInfo, setAccessTokensToServers,
+ cleanupTests,
+ createUser,
+ flushAndRunServer,
+ makeDeleteRequest, makeGetRequest,
+ makePostBodyRequest,
+ ServerInfo,
+ setAccessTokensToServers,
userLogin
} from '../../../../shared/extra-utils'
import {
it('Should fail with an incorrect sort', async function () {
await checkBadSortPagination(server.url, path)
})
+
+ it('Should fail with an incorrect state', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ query: {
+ state: 'blabla'
+ }
+ })
+ })
+
+ it('Should fail with an incorrect actor type', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ query: {
+ actorType: 'blabla'
+ }
+ })
+ })
+
+ it('Should fail succeed with the correct params', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ statusCodeExpected: 200,
+ query: {
+ state: 'accepted',
+ actorType: 'Application'
+ }
+ })
+ })
})
describe('When listing followers', function () {
it('Should fail with an incorrect sort', async function () {
await checkBadSortPagination(server.url, path)
})
+
+ it('Should fail with an incorrect actor type', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ query: {
+ actorType: 'blabla'
+ }
+ })
+ })
+
+ it('Should fail with an incorrect state', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ query: {
+ state: 'blabla',
+ actorType: 'Application'
+ }
+ })
+ })
+
+ it('Should fail succeed with the correct params', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path,
+ statusCodeExpected: 200,
+ query: {
+ state: 'accepted'
+ }
+ })
+ })
})
describe('When removing a follower', function () {
})
})
- after(function () {
- killallServers([ server ])
+ after(async function () {
+ await cleanupTests([ server ])
})
})