+ const playlist: VideoPlaylist = res.body.data[ 0 ]
+ expect(playlist.displayName).to.equal('Watch later')
+ expect(playlist.type.id).to.equal(VideoPlaylistType.WATCH_LATER)
+ expect(playlist.type.label).to.equal('Watch later')
+ }
+
+ {
+ const res = await getAccountPlaylistsListWithToken(url, accessToken, 'root', 0, 5, VideoPlaylistType.REGULAR)
+
+ expect(res.body.total).to.equal(0)
+ expect(res.body.data).to.have.lengthOf(0)
+ }
+
+ {
+ const res = await getAccountPlaylistsList(url, 'root', 0, 5)
+ expect(res.body.total).to.equal(0)
+ expect(res.body.data).to.have.lengthOf(0)
+ }
+ })
+
+ it('Should create a playlist on server 1 and have the playlist on server 2 and 3', async function () {
+ this.timeout(30000)
+
+ await createVideoPlaylist({
+ url: servers[0].url,
+ token: servers[0].accessToken,
+ playlistAttrs: {
+ displayName: 'my super playlist',
+ privacy: VideoPlaylistPrivacy.PUBLIC,
+ description: 'my super description',
+ thumbnailfile: 'thumbnail.jpg',
+ videoChannelId: servers[0].videoChannel.id
+ }
+ })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const res = await getVideoPlaylistsList(server.url, 0, 5)
+ expect(res.body.total).to.equal(1)
+ expect(res.body.data).to.have.lengthOf(1)
+
+ const playlistFromList = res.body.data[0] as VideoPlaylist
+
+ const res2 = await getVideoPlaylist(server.url, playlistFromList.uuid)
+ const playlistFromGet = res2.body
+
+ for (const playlist of [ playlistFromGet, playlistFromList ]) {
+ expect(playlist.id).to.be.a('number')
+ expect(playlist.uuid).to.be.a('string')
+
+ expect(playlist.isLocal).to.equal(server.serverNumber === 1)
+
+ expect(playlist.displayName).to.equal('my super playlist')
+ expect(playlist.description).to.equal('my super description')
+ expect(playlist.privacy.id).to.equal(VideoPlaylistPrivacy.PUBLIC)
+ expect(playlist.privacy.label).to.equal('Public')
+ expect(playlist.type.id).to.equal(VideoPlaylistType.REGULAR)
+ expect(playlist.type.label).to.equal('Regular')
+
+ expect(playlist.videosLength).to.equal(0)
+
+ expect(playlist.ownerAccount.name).to.equal('root')
+ expect(playlist.ownerAccount.displayName).to.equal('root')
+ expect(playlist.videoChannel.name).to.equal('root_channel')
+ expect(playlist.videoChannel.displayName).to.equal('Main root channel')
+ }
+ }