+ expect(videoPlaylist.videoChannel.avatars.length).to.equal(2, 'Channel should have two avatar images')
+ }
+
+ 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 () {
+ await check({ search: 'E2E playlist', sort: '-match' }, true)
+ })
+
+ it('Should make host search and have appropriate results', async function () {
+ await check({ search: 'E2E playlist', host: 'example.com' }, false)
+ await check({ search: 'E2E playlist', host: 'peertube2.cpy.re', sort: '-match' }, true)
+ })
+
+ it('Should make a search by uuids and have appropriate results', async function () {
+ const goodUUID = '73804a40-da9a-40c2-b1eb-2c6d9eec8f0a'
+ const goodShortUUID = 'fgei1ws1oa6FCaJ2qZPG29'
+ const badUUID = 'c29c5b77-4a04-493d-96a9-2e9267e308f0'
+ const badShortUUID = 'rP5RgUeX9XwTSrspCdkDej'
+
+ {
+ const uuidsMatrix = [
+ [ goodUUID ],
+ [ goodUUID, badShortUUID ],
+ [ badShortUUID, goodShortUUID ],
+ [ goodUUID, goodShortUUID ]
+ ]
+
+ for (const uuids of uuidsMatrix) {
+ const search = { search: 'E2E playlist', sort: '-match', uuids }
+ await check(search, true)
+ }
+ }
+
+ {
+ const uuidsMatrix = [
+ [ badUUID ],
+ [ badShortUUID ]
+ ]
+
+ for (const uuids of uuidsMatrix) {
+ const search = { search: 'E2E playlist', sort: '-match', uuids }
+ await check(search, false)
+ }
+ }