aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/live/live-socket-messages.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-15 10:02:54 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitd23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch)
treeda82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/api/live/live-socket-messages.ts
parent7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff)
downloadPeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst
PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip
Introduce videos command
Diffstat (limited to 'server/tests/api/live/live-socket-messages.ts')
-rw-r--r--server/tests/api/live/live-socket-messages.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts
index 4a6677c0a..1f3d455a8 100644
--- a/server/tests/api/live/live-socket-messages.ts
+++ b/server/tests/api/live/live-socket-messages.ts
@@ -7,12 +7,10 @@ import {
7 cleanupTests, 7 cleanupTests,
8 doubleFollow, 8 doubleFollow,
9 flushAndRunMultipleServers, 9 flushAndRunMultipleServers,
10 getVideoIdFromUUID,
11 ServerInfo, 10 ServerInfo,
12 setAccessTokensToServers, 11 setAccessTokensToServers,
13 setDefaultVideoChannel, 12 setDefaultVideoChannel,
14 stopFfmpeg, 13 stopFfmpeg,
15 viewVideo,
16 wait, 14 wait,
17 waitJobs, 15 waitJobs,
18 waitUntilLivePublishedOnAllServers 16 waitUntilLivePublishedOnAllServers
@@ -71,7 +69,7 @@ describe('Test live', function () {
71 await waitJobs(servers) 69 await waitJobs(servers)
72 70
73 { 71 {
74 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 72 const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
75 73
76 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket() 74 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
77 localSocket.on('state-change', data => localStateChanges.push(data.state)) 75 localSocket.on('state-change', data => localStateChanges.push(data.state))
@@ -79,7 +77,7 @@ describe('Test live', function () {
79 } 77 }
80 78
81 { 79 {
82 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID) 80 const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID })
83 81
84 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket() 82 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
85 remoteSocket.on('state-change', data => remoteStateChanges.push(data.state)) 83 remoteSocket.on('state-change', data => remoteStateChanges.push(data.state))
@@ -119,7 +117,7 @@ describe('Test live', function () {
119 await waitJobs(servers) 117 await waitJobs(servers)
120 118
121 { 119 {
122 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 120 const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
123 121
124 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket() 122 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
125 localSocket.on('views-change', data => { localLastVideoViews = data.views }) 123 localSocket.on('views-change', data => { localLastVideoViews = data.views })
@@ -127,7 +125,7 @@ describe('Test live', function () {
127 } 125 }
128 126
129 { 127 {
130 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID) 128 const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID })
131 129
132 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket() 130 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
133 remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views }) 131 remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views })
@@ -142,8 +140,8 @@ describe('Test live', function () {
142 expect(localLastVideoViews).to.equal(0) 140 expect(localLastVideoViews).to.equal(0)
143 expect(remoteLastVideoViews).to.equal(0) 141 expect(remoteLastVideoViews).to.equal(0)
144 142
145 await viewVideo(servers[0].url, liveVideoUUID) 143 await servers[0].videosCommand.view({ id: liveVideoUUID })
146 await viewVideo(servers[1].url, liveVideoUUID) 144 await servers[1].videosCommand.view({ id: liveVideoUUID })
147 145
148 await waitJobs(servers) 146 await waitJobs(servers)
149 await wait(5000) 147 await wait(5000)
@@ -163,7 +161,7 @@ describe('Test live', function () {
163 const liveVideoUUID = await createLiveWrapper() 161 const liveVideoUUID = await createLiveWrapper()
164 await waitJobs(servers) 162 await waitJobs(servers)
165 163
166 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 164 const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID })
167 165
168 const socket = servers[0].socketIOCommand.getLiveNotificationSocket() 166 const socket = servers[0].socketIOCommand.getLiveNotificationSocket()
169 socket.on('state-change', data => stateChanges.push(data.state)) 167 socket.on('state-change', data => stateChanges.push(data.state))