- const res = await getVideoChannelsList(servers[0].url, 0, 5)
- expect(res.body.total).to.equal(3)
- expect(res.body.data).to.have.lengthOf(3)
- expect(res.body.data[0].name).to.equal('channel1_server1')
- expect(res.body.data[1].name).to.equal('user1_server1_channel')
- expect(res.body.data[2].name).to.equal('root_channel')
+ const body = await servers[0].channels.list()
+ expect(body.total).to.equal(3)
+ expect(body.data).to.have.lengthOf(3)
+ expect(body.data[0].name).to.equal('channel1_server1')
+ expect(body.data[1].name).to.equal('user1_server1_channel')
+ expect(body.data[2].name).to.equal('root_channel')
+ })
+
+ it('Should list video channel videos of server 2 without token', async function () {
+ this.timeout(30000)
+
+ await waitJobs(servers)
+
+ const { total, data } = await servers[0].videos.listByChannel({
+ token: null,
+ handle: 'channel1_server2@localhost:' + servers[1].port
+ })
+ expect(total).to.equal(0)
+ expect(data).to.have.lengthOf(0)
+ })
+
+ it('Should list video channel videos of server 2 with token', async function () {
+ const { total, data } = await servers[0].videos.listByChannel({
+ handle: 'channel1_server2@localhost:' + servers[1].port
+ })
+
+ expect(total).to.equal(1)
+ expect(data[0].name).to.equal('video 1 server 2')