]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/search.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / search.ts
index aa81965f33362e32d29890e8c0b2c226185fec4e..f8d0cd4ecea43664d03aa1a03872aee67394d2db 100644 (file)
@@ -1,13 +1,13 @@
-/* tslint:disable:no-unused-expression */
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
 import 'mocha'
 
-import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer, ServerInfo } from '../../../../shared/utils'
+import { cleanupTests, flushAndRunServer, immutableAssign, makeGetRequest, ServerInfo } from '../../../../shared/extra-utils'
 import {
   checkBadCountPagination,
   checkBadSortPagination,
   checkBadStartPagination
-} from '../../../../shared/utils/requests/check-api-params'
+} from '../../../../shared/extra-utils/requests/check-api-params'
 
 describe('Test videos API validator', function () {
   let server: ServerInfo
@@ -17,9 +17,7 @@ describe('Test videos API validator', function () {
   before(async function () {
     this.timeout(30000)
 
-    await flushTests()
-
-    server = await runServer(1)
+    server = await flushAndRunServer(1)
   })
 
   describe('When searching videos', function () {
@@ -113,6 +111,12 @@ describe('Test videos API validator', function () {
 
       const customQuery2 = immutableAssign(query, { endDate: 'hello' })
       await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: 400 })
+
+      const customQuery3 = immutableAssign(query, { originallyPublishedStartDate: 'hello' })
+      await makeGetRequest({ url: server.url, path, query: customQuery3, statusCodeExpected: 400 })
+
+      const customQuery4 = immutableAssign(query, { originallyPublishedEndDate: 'hello' })
+      await makeGetRequest({ url: server.url, path, query: customQuery4, statusCodeExpected: 400 })
     })
   })
 
@@ -141,11 +145,6 @@ describe('Test videos API validator', function () {
   })
 
   after(async function () {
-    killallServers([ server ])
-
-    // Keep the logs if the test failed
-    if (this['ok']) {
-      await flushTests()
-    }
+    await cleanupTests([ server ])
   })
 })