+ it('Should return the channel object', async function () {
+ await testChannel('/video-channels/root_channel')
+ await testChannel('/c/root_channel')
+ })
+
+ it('Should return the video object', async function () {
+ await testVideo('/videos/watch/' + video.id)
+ await testVideo('/videos/watch/' + video.uuid)
+ await testVideo('/videos/watch/' + video.shortUUID)
+ await testVideo('/w/' + video.id)
+ await testVideo('/w/' + video.uuid)
+ await testVideo('/w/' + video.shortUUID)
+ })
+
+ it('Should return the playlist object', async function () {
+ await testPlaylist('/video-playlists/' + playlist.id)
+ await testPlaylist('/video-playlists/' + playlist.uuid)
+ await testPlaylist('/video-playlists/' + playlist.shortUUID)
+ await testPlaylist('/w/p/' + playlist.id)
+ await testPlaylist('/w/p/' + playlist.uuid)
+ await testPlaylist('/w/p/' + playlist.shortUUID)
+ await testPlaylist('/videos/watch/playlist/' + playlist.id)
+ await testPlaylist('/videos/watch/playlist/' + playlist.uuid)
+ await testPlaylist('/videos/watch/playlist/' + playlist.shortUUID)
+ })
+
+ it('Should redirect to the origin video object', async function () {
+ const res = await makeActivityPubGetRequest(servers[1].url, '/videos/watch/' + video.uuid, HttpStatusCode.FOUND_302)
+
+ expect(res.header.location).to.equal(servers[0].url + '/videos/watch/' + video.uuid)
+ })
+
+ it('Should return the watch action', async function () {
+ this.timeout(50000)
+
+ await servers[0].views.simulateViewer({ id: video.uuid, currentTimes: [ 0, 2 ] })
+ await processViewersStats(servers)
+
+ const res = await makeActivityPubGetRequest(servers[0].url, '/videos/local-viewer/1', HttpStatusCode.OK_200)
+
+ const object: WatchActionObject = res.body
+ expect(object.type).to.equal('WatchAction')
+ expect(object.duration).to.equal('PT2S')
+ expect(object.actionStatus).to.equal('CompletedActionStatus')
+ expect(object.watchSections).to.have.lengthOf(1)
+ expect(object.watchSections[0].startTimestamp).to.equal(0)
+ expect(object.watchSections[0].endTimestamp).to.equal(2)