aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/search/search-videos.ts8
-rw-r--r--server/tests/api/videos/video-nsfw.ts11
2 files changed, 15 insertions, 4 deletions
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts
index 7fc133b46..d2b0f0312 100644
--- a/server/tests/api/search/search-videos.ts
+++ b/server/tests/api/search/search-videos.ts
@@ -216,7 +216,7 @@ describe('Test a videos search', function () {
216 search: '1111 2222 3333', 216 search: '1111 2222 3333',
217 languageOneOf: [ 'pl', 'fr' ], 217 languageOneOf: [ 'pl', 'fr' ],
218 durationMax: 4, 218 durationMax: 4,
219 nsfw: false, 219 nsfw: 'false' as 'false',
220 licenceOneOf: [ 1, 4 ] 220 licenceOneOf: [ 1, 4 ]
221 } 221 }
222 222
@@ -235,7 +235,7 @@ describe('Test a videos search', function () {
235 search: '1111 2222 3333', 235 search: '1111 2222 3333',
236 languageOneOf: [ 'pl', 'fr' ], 236 languageOneOf: [ 'pl', 'fr' ],
237 durationMax: 4, 237 durationMax: 4,
238 nsfw: false, 238 nsfw: 'false' as 'false',
239 licenceOneOf: [ 1, 4 ], 239 licenceOneOf: [ 1, 4 ],
240 sort: '-name' 240 sort: '-name'
241 } 241 }
@@ -255,7 +255,7 @@ describe('Test a videos search', function () {
255 search: '1111 2222 3333', 255 search: '1111 2222 3333',
256 languageOneOf: [ 'pl', 'fr' ], 256 languageOneOf: [ 'pl', 'fr' ],
257 durationMax: 4, 257 durationMax: 4,
258 nsfw: false, 258 nsfw: 'false' as 'false',
259 licenceOneOf: [ 1, 4 ], 259 licenceOneOf: [ 1, 4 ],
260 sort: '-name', 260 sort: '-name',
261 start: 0, 261 start: 0,
@@ -274,7 +274,7 @@ describe('Test a videos search', function () {
274 search: '1111 2222 3333', 274 search: '1111 2222 3333',
275 languageOneOf: [ 'pl', 'fr' ], 275 languageOneOf: [ 'pl', 'fr' ],
276 durationMax: 4, 276 durationMax: 4,
277 nsfw: false, 277 nsfw: 'false' as 'false',
278 licenceOneOf: [ 1, 4 ], 278 licenceOneOf: [ 1, 4 ],
279 sort: '-name', 279 sort: '-name',
280 start: 3, 280 start: 3,
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts
index 38bdaa54e..370e69d2a 100644
--- a/server/tests/api/videos/video-nsfw.ts
+++ b/server/tests/api/videos/video-nsfw.ts
@@ -220,6 +220,17 @@ describe('Test video NSFW policy', function () {
220 expect(videos[ 0 ].name).to.equal('normal') 220 expect(videos[ 0 ].name).to.equal('normal')
221 } 221 }
222 }) 222 })
223
224 it('Should display both videos when the nsfw param === both', async function () {
225 for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'both' })) {
226 expect(res.body.total).to.equal(2)
227
228 const videos = res.body.data
229 expect(videos).to.have.lengthOf(2)
230 expect(videos[ 0 ].name).to.equal('normal')
231 expect(videos[ 1 ].name).to.equal('nsfw')
232 }
233 })
223 }) 234 })
224 235
225 after(async function () { 236 after(async function () {