From 46a6db245f50249246325090eeaffd165453a396 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Jun 2019 16:44:02 +0200 Subject: Add ability to set to private a public/unlisted video --- server/tests/api/videos/video-privacy.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'server/tests/api/videos/video-privacy.ts') diff --git a/server/tests/api/videos/video-privacy.ts b/server/tests/api/videos/video-privacy.ts index ef1cf0f07..40b539106 100644 --- a/server/tests/api/videos/video-privacy.ts +++ b/server/tests/api/videos/video-privacy.ts @@ -6,8 +6,7 @@ import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enu import { cleanupTests, flushAndRunMultipleServers, - getVideosList, - killallServers, + getVideosList, getVideosListWithToken, ServerInfo, setAccessTokensToServers, uploadVideo @@ -153,6 +152,29 @@ describe('Test video privacy', function () { } }) + it('Should set this new video as private', async function () { + this.timeout(10000) + + await updateVideo(servers[0].url, servers[0].accessToken, privateVideoId, { privacy: VideoPrivacy.PRIVATE }) + + await waitJobs(servers) + + for (const server of servers) { + const res = await getVideosList(server.url) + + expect(res.body.total).to.equal(0) + expect(res.body.data).to.have.lengthOf(0) + } + + { + const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 5) + + expect(res.body.total).to.equal(1) + expect(res.body.data).to.have.lengthOf(1) + expect(res.body.data[0].name).to.equal('super video public') + } + }) + after(async function () { await cleanupTests(servers) }) -- cgit v1.2.3