]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/jobs.ts
Upgrade server dep
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / jobs.ts
index 682406e87282a98d55043866931b436b084019e0..22e23796477b99f4d6a92acd5fc5fcda2d0d2760 100644 (file)
@@ -6,10 +6,11 @@ import {
   createUser,
   flushTests,
   killallServers,
-  runServer,
+  flushAndRunServer,
   ServerInfo,
   setAccessTokensToServers,
-  userLogin
+  userLogin,
+  cleanupTests
 } from '../../../../shared/extra-utils'
 import {
   checkBadCountPagination,
@@ -28,9 +29,7 @@ describe('Test jobs API validators', function () {
   before(async function () {
     this.timeout(120000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
 
     await setAccessTokensToServers([ server ])
 
@@ -52,6 +51,17 @@ describe('Test jobs API validators', function () {
       })
     })
 
+    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)
     })
@@ -80,14 +90,10 @@ describe('Test jobs API validators', function () {
         statusCodeExpected: 403
       })
     })
+
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })