diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-28 16:40:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-28 16:40:21 +0200 |
commit | fbd67e7f386504e50f2504cb6386700a58906f16 (patch) | |
tree | 1a7143aaea76ce4e195fb9d6214a0cd769c556ea /server/tests/api/check-params/search.ts | |
parent | 164c8d46cf5c948a28b4ac0e596fad9b83b2c229 (diff) | |
download | PeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.tar.gz PeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.tar.zst PeerTube-fbd67e7f386504e50f2504cb6386700a58906f16.zip |
Add ability to search by uuids/actor names
Diffstat (limited to 'server/tests/api/check-params/search.ts')
-rw-r--r-- | server/tests/api/check-params/search.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 72ad6c842..789ea7754 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts | |||
@@ -146,6 +146,16 @@ describe('Test videos API validator', function () { | |||
146 | const customQuery = { ...query, host: 'example.com' } | 146 | const customQuery = { ...query, host: 'example.com' } |
147 | await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) | 147 | await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) |
148 | }) | 148 | }) |
149 | |||
150 | it('Should fail with invalid uuids', async function () { | ||
151 | const customQuery = { ...query, uuids: [ '6565', 'dfd70b83-639f-4980-94af-304a56ab4b35' ] } | ||
152 | await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
153 | }) | ||
154 | |||
155 | it('Should succeed with valid uuids', async function () { | ||
156 | const customQuery = { ...query, uuids: [ 'dfd70b83-639f-4980-94af-304a56ab4b35' ] } | ||
157 | await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) | ||
158 | }) | ||
149 | }) | 159 | }) |
150 | 160 | ||
151 | describe('When searching video playlists', function () { | 161 | describe('When searching video playlists', function () { |
@@ -172,6 +182,11 @@ describe('Test videos API validator', function () { | |||
172 | await makeGetRequest({ url: server.url, path, query: { ...query, host: '6565' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 182 | await makeGetRequest({ url: server.url, path, query: { ...query, host: '6565' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
173 | }) | 183 | }) |
174 | 184 | ||
185 | it('Should fail with invalid uuids', async function () { | ||
186 | const customQuery = { ...query, uuids: [ '6565', 'dfd70b83-639f-4980-94af-304a56ab4b35' ] } | ||
187 | await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | ||
188 | }) | ||
189 | |||
175 | it('Should succeed with the correct parameters', async function () { | 190 | it('Should succeed with the correct parameters', async function () { |
176 | await makeGetRequest({ url: server.url, path, query, expectedStatus: HttpStatusCode.OK_200 }) | 191 | await makeGetRequest({ url: server.url, path, query, expectedStatus: HttpStatusCode.OK_200 }) |
177 | }) | 192 | }) |