aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live-views.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/live/live-views.ts')
-rw-r--r--server/tests/api/live/live-views.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/server/tests/api/live/live-views.ts b/server/tests/api/live/live-views.ts
index 75f95b167..1951b11a5 100644
--- a/server/tests/api/live/live-views.ts
+++ b/server/tests/api/live/live-views.ts
@@ -3,17 +3,15 @@
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { FfmpegCommand } from 'fluent-ffmpeg' 5import { FfmpegCommand } from 'fluent-ffmpeg'
6import { VideoDetails, VideoPrivacy } from '@shared/models' 6import { VideoPrivacy } from '@shared/models'
7import { 7import {
8 cleanupTests, 8 cleanupTests,
9 doubleFollow, 9 doubleFollow,
10 flushAndRunMultipleServers, 10 flushAndRunMultipleServers,
11 getVideo,
12 ServerInfo, 11 ServerInfo,
13 setAccessTokensToServers, 12 setAccessTokensToServers,
14 setDefaultVideoChannel, 13 setDefaultVideoChannel,
15 stopFfmpeg, 14 stopFfmpeg,
16 viewVideo,
17 wait, 15 wait,
18 waitJobs, 16 waitJobs,
19 waitUntilLivePublishedOnAllServers 17 waitUntilLivePublishedOnAllServers
@@ -55,9 +53,7 @@ describe('Test live', function () {
55 53
56 async function countViews (expected: number) { 54 async function countViews (expected: number) {
57 for (const server of servers) { 55 for (const server of servers) {
58 const res = await getVideo(server.url, liveVideoId) 56 const video = await server.videosCommand.get({ id: liveVideoId })
59 const video: VideoDetails = res.body
60
61 expect(video.views).to.equal(expected) 57 expect(video.views).to.equal(expected)
62 } 58 }
63 } 59 }
@@ -86,8 +82,8 @@ describe('Test live', function () {
86 it('Should view a live twice and display 1 view', async function () { 82 it('Should view a live twice and display 1 view', async function () {
87 this.timeout(30000) 83 this.timeout(30000)
88 84
89 await viewVideo(servers[0].url, liveVideoId) 85 await servers[0].videosCommand.view({ id: liveVideoId })
90 await viewVideo(servers[0].url, liveVideoId) 86 await servers[0].videosCommand.view({ id: liveVideoId })
91 87
92 await wait(7000) 88 await wait(7000)
93 89
@@ -108,9 +104,9 @@ describe('Test live', function () {
108 it('Should view a live on a remote and on local and display 2 views', async function () { 104 it('Should view a live on a remote and on local and display 2 views', async function () {
109 this.timeout(30000) 105 this.timeout(30000)
110 106
111 await viewVideo(servers[0].url, liveVideoId) 107 await servers[0].videosCommand.view({ id: liveVideoId })
112 await viewVideo(servers[1].url, liveVideoId) 108 await servers[1].videosCommand.view({ id: liveVideoId })
113 await viewVideo(servers[1].url, liveVideoId) 109 await servers[1].videosCommand.view({ id: liveVideoId })
114 110
115 await wait(7000) 111 await wait(7000)
116 await waitJobs(servers) 112 await waitJobs(servers)