]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/utils/requests/check-api-params.ts
Fix caption upload on Mac OS
[github/Chocobozzz/PeerTube.git] / server / tests / utils / requests / check-api-params.ts
index fbd660629b8217a059b51cfc48d4711741606239..edb47e0e96dd092ff20e6a18e76af50698dad158 100644 (file)
@@ -1,28 +1,32 @@
 import { makeGetRequest } from './requests'
+import { immutableAssign } from '..'
 
-function checkBadStartPagination (url: string, path: string) {
+function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
   return makeGetRequest({
     url,
     path,
-    query: { start: 'hello' },
+    token,
+    query: immutableAssign(query, { start: 'hello' }),
     statusCodeExpected: 400
   })
 }
 
-function checkBadCountPagination (url: string, path: string) {
+function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
   return makeGetRequest({
     url,
     path,
-    query: { count: 'hello' },
+    token,
+    query: immutableAssign(query, { count: 'hello' }),
     statusCodeExpected: 400
   })
 }
 
-function checkBadSortPagination (url: string, path: string) {
+function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {
   return makeGetRequest({
     url,
     path,
-    query: { sort: 'hello' },
+    token,
+    query: immutableAssign(query, { sort: 'hello' }),
     statusCodeExpected: 400
   })
 }