+ it('Should correctly list the playlists', async function () {
+ this.timeout(30000)
+
+ {
+ const res = await getVideoPlaylistsList(servers[2].url, 1, 2, 'createdAt')
+
+ expect(res.body.total).to.equal(3)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(2)
+ expect(data[0].displayName).to.equal('playlist 2')
+ expect(data[1].displayName).to.equal('playlist 3')
+ }
+
+ {
+ const res = await getVideoPlaylistsList(servers[2].url, 1, 2, '-createdAt')
+
+ expect(res.body.total).to.equal(3)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(2)
+ expect(data[0].displayName).to.equal('playlist 2')
+ expect(data[1].displayName).to.equal('my super playlist')
+ }
+ })
+
+ it('Should list video channel playlists', async function () {
+ this.timeout(30000)
+
+ {
+ const res = await getVideoChannelPlaylistsList(servers[0].url, 'root_channel', 0, 2, '-createdAt')
+
+ expect(res.body.total).to.equal(1)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].displayName).to.equal('my super playlist')
+ }
+ })
+
+ it('Should list account playlists', async function () {
+ this.timeout(30000)
+
+ {
+ const res = await getAccountPlaylistsList(servers[1].url, 'root', 1, 2, '-createdAt')
+
+ expect(res.body.total).to.equal(2)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].displayName).to.equal('playlist 2')
+ }
+
+ {
+ const res = await getAccountPlaylistsList(servers[1].url, 'root', 1, 2, 'createdAt')
+
+ expect(res.body.total).to.equal(2)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].displayName).to.equal('playlist 3')
+ }
+
+ {
+ const res = await getAccountPlaylistsList(servers[1].url, 'root', 0, 10, 'createdAt', '3')
+
+ expect(res.body.total).to.equal(1)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(1)
+ expect(data[0].displayName).to.equal('playlist 3')
+ }
+
+ {
+ const res = await getAccountPlaylistsList(servers[1].url, 'root', 0, 10, 'createdAt', '4')
+
+ expect(res.body.total).to.equal(0)
+
+ const data: VideoPlaylist[] = res.body.data
+ expect(data).to.have.lengthOf(0)
+ }
+ })
+
+ it('Should not list unlisted or private playlists', async function () {
+ this.timeout(30000)
+
+ await createVideoPlaylist({