-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import 'mocha'
import {
+ cleanupTests,
createUser,
- flushTests,
- killallServers,
- runServer,
+ flushAndRunServer,
ServerInfo,
setAccessTokensToServers,
userLogin
-} from '../../../../shared/utils'
+} from '../../../../shared/extra-utils'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination
-} from '../../../../shared/utils/requests/check-api-params'
-import { makeGetRequest } from '../../../../shared/utils/requests/requests'
+} from '../../../../shared/extra-utils/requests/check-api-params'
+import { makeGetRequest } from '../../../../shared/extra-utils/requests/requests'
describe('Test jobs API validators', function () {
const path = '/api/v1/jobs/failed'
before(async function () {
this.timeout(120000)
- await flushTests()
-
- server = await runServer(1)
+ server = await flushAndRunServer(1)
await setAccessTokensToServers([ server ])
})
})
+ it('Should fail with an incorrect job type', async function () {
+ await makeGetRequest({
+ url: server.url,
+ token: server.accessToken,
+ path,
+ query: {
+ jobType: 'toto'
+ }
+ })
+ })
+
it('Should fail with a bad start pagination', async function () {
await checkBadStartPagination(server.url, path, server.accessToken)
})
statusCodeExpected: 403
})
})
+
})
after(async function () {
- killallServers([ server ])
-
- // Keep the logs if the test failed
- if (this['ok']) {
- await flushTests()
- }
+ await cleanupTests([ server ])
})
})