+ const body = await command.advancedChannelSearch({ search: { search: 'root', start: 0, count: 2 } })
+
+ expect(body.total).to.be.greaterThan(2)
+ expect(body.data).to.have.lengthOf(2)
+ })
+ })
+
+ describe('Playlists search', async function () {
+
+ it('Should make a simple search and not have results', async function () {
+ const body = await command.searchPlaylists({ search: 'a'.repeat(500) })
+
+ expect(body.total).to.equal(0)
+ expect(body.data).to.have.lengthOf(0)
+ })
+
+ it('Should make a search and have results', async function () {
+ const body = await command.advancedPlaylistSearch({ search: { search: 'E2E playlist', sort: '-match' } })
+
+ expect(body.total).to.be.greaterThan(0)
+ expect(body.data).to.have.length.greaterThan(0)
+
+ const videoPlaylist = body.data[0]
+
+ expect(videoPlaylist.url).to.equal('https://peertube2.cpy.re/videos/watch/playlist/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a')
+ expect(videoPlaylist.thumbnailUrl).to.exist
+ expect(videoPlaylist.embedUrl).to.equal('https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a')
+
+ expect(videoPlaylist.type.id).to.equal(VideoPlaylistType.REGULAR)
+ expect(videoPlaylist.privacy.id).to.equal(VideoPlaylistPrivacy.PUBLIC)
+ expect(videoPlaylist.videosLength).to.exist
+
+ expect(videoPlaylist.createdAt).to.exist
+ expect(videoPlaylist.updatedAt).to.exist
+
+ expect(videoPlaylist.uuid).to.equal('73804a40-da9a-40c2-b1eb-2c6d9eec8f0a')
+ expect(videoPlaylist.displayName).to.exist
+
+ expect(videoPlaylist.ownerAccount.url).to.equal('https://peertube2.cpy.re/accounts/chocobozzz')
+ expect(videoPlaylist.ownerAccount.name).to.equal('chocobozzz')
+ expect(videoPlaylist.ownerAccount.host).to.equal('peertube2.cpy.re')
+ expect(videoPlaylist.ownerAccount.avatar).to.exist
+
+ expect(videoPlaylist.videoChannel.url).to.equal('https://peertube2.cpy.re/video-channels/chocobozzz_channel')
+ expect(videoPlaylist.videoChannel.name).to.equal('chocobozzz_channel')
+ expect(videoPlaylist.videoChannel.host).to.equal('peertube2.cpy.re')
+ expect(videoPlaylist.videoChannel.avatar).to.exist
+ })
+
+ it('Should have a correct pagination', async function () {
+ const body = await command.advancedChannelSearch({ search: { search: 'root', start: 0, count: 2 } })