aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/search.ts')
-rw-r--r--server/tests/api/check-params/search.ts27
1 files changed, 26 insertions, 1 deletions
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts
index d35eac7fe..eabf602ac 100644
--- a/server/tests/api/check-params/search.ts
+++ b/server/tests/api/check-params/search.ts
@@ -6,7 +6,6 @@ import { flushTests, immutableAssign, killallServers, makeGetRequest, runServer,
6import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params' 6import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
7 7
8describe('Test videos API validator', function () { 8describe('Test videos API validator', function () {
9 const path = '/api/v1/search/videos/'
10 let server: ServerInfo 9 let server: ServerInfo
11 10
12 // --------------------------------------------------------------- 11 // ---------------------------------------------------------------
@@ -20,6 +19,8 @@ describe('Test videos API validator', function () {
20 }) 19 })
21 20
22 describe('When searching videos', function () { 21 describe('When searching videos', function () {
22 const path = '/api/v1/search/videos/'
23
23 const query = { 24 const query = {
24 search: 'coucou' 25 search: 'coucou'
25 } 26 }
@@ -111,6 +112,30 @@ describe('Test videos API validator', function () {
111 }) 112 })
112 }) 113 })
113 114
115 describe('When searching video channels', function () {
116 const path = '/api/v1/search/video-channels/'
117
118 const query = {
119 search: 'coucou'
120 }
121
122 it('Should fail with a bad start pagination', async function () {
123 await checkBadStartPagination(server.url, path, null, query)
124 })
125
126 it('Should fail with a bad count pagination', async function () {
127 await checkBadCountPagination(server.url, path, null, query)
128 })
129
130 it('Should fail with an incorrect sort', async function () {
131 await checkBadSortPagination(server.url, path, null, query)
132 })
133
134 it('Should success with the correct parameters', async function () {
135 await makeGetRequest({ url: server.url, path, query, statusCodeExpected: 200 })
136 })
137 })
138
114 after(async function () { 139 after(async function () {
115 killallServers([ server ]) 140 killallServers([ server ])
116 141