aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/live/live-socket-messages.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts
index 0159d5199..20fec16a9 100644
--- a/server/tests/api/live/live-socket-messages.ts
+++ b/server/tests/api/live/live-socket-messages.ts
@@ -2,7 +2,6 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { getLiveNotificationSocket } from '@shared/extra-utils/socket/socket-io'
6import { VideoPrivacy, VideoState } from '@shared/models' 5import { VideoPrivacy, VideoState } from '@shared/models'
7import { 6import {
8 cleanupTests, 7 cleanupTests,
@@ -77,7 +76,7 @@ describe('Test live', function () {
77 { 76 {
78 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 77 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
79 78
80 const localSocket = getLiveNotificationSocket(servers[0].url) 79 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
81 localSocket.on('state-change', data => localStateChanges.push(data.state)) 80 localSocket.on('state-change', data => localStateChanges.push(data.state))
82 localSocket.emit('subscribe', { videoId }) 81 localSocket.emit('subscribe', { videoId })
83 } 82 }
@@ -85,7 +84,7 @@ describe('Test live', function () {
85 { 84 {
86 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID) 85 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID)
87 86
88 const remoteSocket = getLiveNotificationSocket(servers[1].url) 87 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
89 remoteSocket.on('state-change', data => remoteStateChanges.push(data.state)) 88 remoteSocket.on('state-change', data => remoteStateChanges.push(data.state))
90 remoteSocket.emit('subscribe', { videoId }) 89 remoteSocket.emit('subscribe', { videoId })
91 } 90 }
@@ -125,7 +124,7 @@ describe('Test live', function () {
125 { 124 {
126 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 125 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
127 126
128 const localSocket = getLiveNotificationSocket(servers[0].url) 127 const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket()
129 localSocket.on('views-change', data => { localLastVideoViews = data.views }) 128 localSocket.on('views-change', data => { localLastVideoViews = data.views })
130 localSocket.emit('subscribe', { videoId }) 129 localSocket.emit('subscribe', { videoId })
131 } 130 }
@@ -133,7 +132,7 @@ describe('Test live', function () {
133 { 132 {
134 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID) 133 const videoId = await getVideoIdFromUUID(servers[1].url, liveVideoUUID)
135 134
136 const remoteSocket = getLiveNotificationSocket(servers[1].url) 135 const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket()
137 remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views }) 136 remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views })
138 remoteSocket.emit('subscribe', { videoId }) 137 remoteSocket.emit('subscribe', { videoId })
139 } 138 }
@@ -169,7 +168,7 @@ describe('Test live', function () {
169 168
170 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID) 169 const videoId = await getVideoIdFromUUID(servers[0].url, liveVideoUUID)
171 170
172 const socket = getLiveNotificationSocket(servers[0].url) 171 const socket = servers[0].socketIOCommand.getLiveNotificationSocket()
173 socket.on('state-change', data => stateChanges.push(data.state)) 172 socket.on('state-change', data => stateChanges.push(data.state))
174 socket.emit('subscribe', { videoId }) 173 socket.emit('subscribe', { videoId })
175 174