- const secondUserInformationResponse = await getMyUserInformation(server.url, secondUserAccessToken)
- const secondUserInformation: User = secondUserInformationResponse.body
- const channelId = secondUserInformation.videoChannels[0].id
- await acceptChangeOwnership(server.url, secondUserAccessToken, lastRequestChangeOwnershipId, channelId)
+ await command.accept({ token: secondUserToken, ownershipId: lastRequestId, channelId: secondUserChannelId })
+
+ await waitJobs(servers)
+ })
+
+ it('Should have the channel of the video updated', async function () {
+ for (const server of servers) {
+ const video = await server.videos.get({ id: servers[0].store.videoCreated.uuid })
+
+ expect(video.name).to.equal('my super name')
+ expect(video.channel.displayName).to.equal('Main second channel')
+ expect(video.channel.name).to.equal('second_channel')
+ }
+ })
+
+ it('Should send a request to change ownership of a live', async function () {
+ this.timeout(15000)
+
+ await command.create({ token: firstUserToken, videoId: liveId, username: secondUser })
+
+ const body = await command.list({ token: secondUserToken })
+
+ expect(body.total).to.equal(3)
+ expect(body.data.length).to.equal(3)
+
+ lastRequestId = body.data[0].id
+ })
+
+ it('Should accept a live ownership change', async function () {
+ this.timeout(20000)
+
+ await command.accept({ token: secondUserToken, ownershipId: lastRequestId, channelId: secondUserChannelId })
+
+ await waitJobs(servers)
+
+ for (const server of servers) {
+ const video = await server.videos.get({ id: servers[0].store.videoCreated.uuid })
+
+ expect(video.name).to.equal('my super name')
+ expect(video.channel.displayName).to.equal('Main second channel')
+ expect(video.channel.name).to.equal('second_channel')
+ }