diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-24 11:04:02 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 09:41:54 +0200 |
commit | f5b0af50c85e2f8b6b2b054ac1f47123cacbe08d (patch) | |
tree | 1b2f8a578b2d35138ac326d65674a9c9d740e8c9 /server/tests/api/check-params | |
parent | aa55a4da422330fe2816f1764b64f6607a0ca4aa (diff) | |
download | PeerTube-f5b0af50c85e2f8b6b2b054ac1f47123cacbe08d.tar.gz PeerTube-f5b0af50c85e2f8b6b2b054ac1f47123cacbe08d.tar.zst PeerTube-f5b0af50c85e2f8b6b2b054ac1f47123cacbe08d.zip |
Search video channel handle/uri
Diffstat (limited to 'server/tests/api/check-params')
-rw-r--r-- | server/tests/api/check-params/search.ts | 27 |
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, | |||
6 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params' | 6 | import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params' |
7 | 7 | ||
8 | describe('Test videos API validator', function () { | 8 | describe('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 | ||