From 1b319b7aa6d2f4252615b370aaca6a800be1b1f4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Jun 2019 17:29:15 +0200 Subject: Add ability to unpublish video/playlist --- server/tests/api/check-params/video-playlists.ts | 12 --------- server/tests/api/videos/video-playlists.ts | 34 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 12 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index b7b94c035..8c5e44bdd 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts @@ -205,7 +205,6 @@ describe('Test video playlists API validator', function () { const params = getBase({ displayName: undefined }) await createVideoPlaylist(params) - await updateVideoPlaylist(getUpdate(params, playlistUUID)) }) it('Should fail with an incorrect display name', async function () { @@ -269,17 +268,6 @@ describe('Test video playlists API validator', function () { )) }) - it('Should fail to update to private a public/unlisted playlist', async function () { - const params = getBase({ privacy: VideoPlaylistPrivacy.PUBLIC }, { expectedStatus: 200 }) - - const res = await createVideoPlaylist(params) - const playlist = res.body.videoPlaylist - - const paramsUpdate = getBase({ privacy: VideoPlaylistPrivacy.PRIVATE }, { expectedStatus: 400 }) - - await updateVideoPlaylist(getUpdate(paramsUpdate, playlist.id)) - }) - it('Should fail to update the watch later playlist', async function () { await updateVideoPlaylist(getUpdate( getBase({}, { expectedStatus: 400 }), diff --git a/server/tests/api/videos/video-playlists.ts b/server/tests/api/videos/video-playlists.ts index 3ebb1df0b..8690327c4 100644 --- a/server/tests/api/videos/video-playlists.ts +++ b/server/tests/api/videos/video-playlists.ts @@ -754,6 +754,40 @@ describe('Test video playlists', function () { } }) + + it('Should be able to create a public playlist, and set it to private', async function () { + this.timeout(30000) + + const res = await createVideoPlaylist({ + url: servers[0].url, + token: servers[0].accessToken, + playlistAttrs: { + displayName: 'my super public playlist', + privacy: VideoPlaylistPrivacy.PUBLIC, + videoChannelId: servers[0].videoChannel.id + } + }) + const videoPlaylistIds = res.body.videoPlaylist + + await waitJobs(servers) + + for (const server of servers) { + await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 200) + } + + const playlistAttrs = { privacy: VideoPlaylistPrivacy.PRIVATE } + await updateVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistId: videoPlaylistIds.id, playlistAttrs }) + + await waitJobs(servers) + + for (const server of [ servers[1], servers[2] ]) { + await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 404) + } + await getVideoPlaylist(servers[0].url, videoPlaylistIds.uuid, 401) + + await getVideoPlaylistWithToken(servers[0].url, servers[0].accessToken, videoPlaylistIds.uuid, 200) + }) + it('Should delete the playlist on server 1 and delete on server 2 and 3', async function () { this.timeout(30000) -- cgit v1.2.3