]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/videos/video-playlists.ts
Improve registration
[github/Chocobozzz/PeerTube.git] / server / tests / api / videos / video-playlists.ts
index fd5e4c4be03b5932dcdffab11d1f27000ffbac42..f82c8cbce0937f4b19390c9292f702acd4251c6d 100644 (file)
@@ -371,7 +371,7 @@ describe('Test video playlists', function () {
 
     for (const server of servers) {
       const results = [
-        await getAccountPlaylistsList(server.url, 'root@localhost:9002', 0, 5, '-createdAt'),
+        await getAccountPlaylistsList(server.url, 'root@localhost:' + servers[1].port, 0, 5, '-createdAt'),
         await getVideoPlaylistsList(server.url, 0, 2, '-createdAt')
       ]
 
@@ -754,6 +754,39 @@ 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)
 
@@ -770,7 +803,7 @@ describe('Test video playlists', function () {
     this.timeout(30000)
 
     for (const server of servers) {
-      await checkPlaylistFilesWereRemoved(playlistServer1UUID, server.serverNumber)
+      await checkPlaylistFilesWereRemoved(playlistServer1UUID, server.internalServerNumber)
     }
   })