diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/video-playlists.ts | 12 | ||||
-rw-r--r-- | server/tests/api/videos/video-playlists.ts | 34 |
2 files changed, 34 insertions, 12 deletions
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 () { | |||
205 | const params = getBase({ displayName: undefined }) | 205 | const params = getBase({ displayName: undefined }) |
206 | 206 | ||
207 | await createVideoPlaylist(params) | 207 | await createVideoPlaylist(params) |
208 | await updateVideoPlaylist(getUpdate(params, playlistUUID)) | ||
209 | }) | 208 | }) |
210 | 209 | ||
211 | it('Should fail with an incorrect display name', async function () { | 210 | it('Should fail with an incorrect display name', async function () { |
@@ -269,17 +268,6 @@ describe('Test video playlists API validator', function () { | |||
269 | )) | 268 | )) |
270 | }) | 269 | }) |
271 | 270 | ||
272 | it('Should fail to update to private a public/unlisted playlist', async function () { | ||
273 | const params = getBase({ privacy: VideoPlaylistPrivacy.PUBLIC }, { expectedStatus: 200 }) | ||
274 | |||
275 | const res = await createVideoPlaylist(params) | ||
276 | const playlist = res.body.videoPlaylist | ||
277 | |||
278 | const paramsUpdate = getBase({ privacy: VideoPlaylistPrivacy.PRIVATE }, { expectedStatus: 400 }) | ||
279 | |||
280 | await updateVideoPlaylist(getUpdate(paramsUpdate, playlist.id)) | ||
281 | }) | ||
282 | |||
283 | it('Should fail to update the watch later playlist', async function () { | 271 | it('Should fail to update the watch later playlist', async function () { |
284 | await updateVideoPlaylist(getUpdate( | 272 | await updateVideoPlaylist(getUpdate( |
285 | getBase({}, { expectedStatus: 400 }), | 273 | 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 () { | |||
754 | } | 754 | } |
755 | }) | 755 | }) |
756 | 756 | ||
757 | |||
758 | it('Should be able to create a public playlist, and set it to private', async function () { | ||
759 | this.timeout(30000) | ||
760 | |||
761 | const res = await createVideoPlaylist({ | ||
762 | url: servers[0].url, | ||
763 | token: servers[0].accessToken, | ||
764 | playlistAttrs: { | ||
765 | displayName: 'my super public playlist', | ||
766 | privacy: VideoPlaylistPrivacy.PUBLIC, | ||
767 | videoChannelId: servers[0].videoChannel.id | ||
768 | } | ||
769 | }) | ||
770 | const videoPlaylistIds = res.body.videoPlaylist | ||
771 | |||
772 | await waitJobs(servers) | ||
773 | |||
774 | for (const server of servers) { | ||
775 | await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 200) | ||
776 | } | ||
777 | |||
778 | const playlistAttrs = { privacy: VideoPlaylistPrivacy.PRIVATE } | ||
779 | await updateVideoPlaylist({ url: servers[0].url, token: servers[0].accessToken, playlistId: videoPlaylistIds.id, playlistAttrs }) | ||
780 | |||
781 | await waitJobs(servers) | ||
782 | |||
783 | for (const server of [ servers[1], servers[2] ]) { | ||
784 | await getVideoPlaylist(server.url, videoPlaylistIds.uuid, 404) | ||
785 | } | ||
786 | await getVideoPlaylist(servers[0].url, videoPlaylistIds.uuid, 401) | ||
787 | |||
788 | await getVideoPlaylistWithToken(servers[0].url, servers[0].accessToken, videoPlaylistIds.uuid, 200) | ||
789 | }) | ||
790 | |||
757 | it('Should delete the playlist on server 1 and delete on server 2 and 3', async function () { | 791 | it('Should delete the playlist on server 1 and delete on server 2 and 3', async function () { |
758 | this.timeout(30000) | 792 | this.timeout(30000) |
759 | 793 | ||