From 0b18f4aa80df8868bf34605423c7a298dffbb2aa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 20 Jul 2018 18:31:49 +0200 Subject: Add advanced search in client --- server/tests/api/search/search-videos.ts | 8 ++++---- server/tests/api/videos/video-nsfw.ts | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'server/tests/api') 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 () { search: '1111 2222 3333', languageOneOf: [ 'pl', 'fr' ], durationMax: 4, - nsfw: false, + nsfw: 'false' as 'false', licenceOneOf: [ 1, 4 ] } @@ -235,7 +235,7 @@ describe('Test a videos search', function () { search: '1111 2222 3333', languageOneOf: [ 'pl', 'fr' ], durationMax: 4, - nsfw: false, + nsfw: 'false' as 'false', licenceOneOf: [ 1, 4 ], sort: '-name' } @@ -255,7 +255,7 @@ describe('Test a videos search', function () { search: '1111 2222 3333', languageOneOf: [ 'pl', 'fr' ], durationMax: 4, - nsfw: false, + nsfw: 'false' as 'false', licenceOneOf: [ 1, 4 ], sort: '-name', start: 0, @@ -274,7 +274,7 @@ describe('Test a videos search', function () { search: '1111 2222 3333', languageOneOf: [ 'pl', 'fr' ], durationMax: 4, - nsfw: false, + nsfw: 'false' as 'false', licenceOneOf: [ 1, 4 ], sort: '-name', 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 () { expect(videos[ 0 ].name).to.equal('normal') } }) + + it('Should display both videos when the nsfw param === both', async function () { + for (const res of await getVideosFunctions(server.accessToken, { nsfw: 'both' })) { + expect(res.body.total).to.equal(2) + + const videos = res.body.data + expect(videos).to.have.lengthOf(2) + expect(videos[ 0 ].name).to.equal('normal') + expect(videos[ 1 ].name).to.equal('nsfw') + } + }) }) after(async function () { -- cgit v1.2.3