aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/feeds/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/feeds/feeds.ts')
-rw-r--r--server/tests/feeds/feeds.ts24
1 files changed, 10 insertions, 14 deletions
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts
index 18ce8f7c5..c66cdde1b 100644
--- a/server/tests/feeds/feeds.ts
+++ b/server/tests/feeds/feeds.ts
@@ -11,8 +11,6 @@ import {
11 flushAndRunServer, 11 flushAndRunServer,
12 ServerInfo, 12 ServerInfo,
13 setAccessTokensToServers, 13 setAccessTokensToServers,
14 uploadVideo,
15 uploadVideoAndGetId,
16 waitJobs 14 waitJobs
17} from '@shared/extra-utils' 15} from '@shared/extra-utils'
18import { VideoPrivacy } from '@shared/models' 16import { VideoPrivacy } from '@shared/models'
@@ -68,28 +66,26 @@ describe('Test syndication feeds', () => {
68 } 66 }
69 67
70 { 68 {
71 await uploadVideo(servers[0].url, userAccessToken, { name: 'user video' }) 69 await servers[0].videosCommand.upload({ token: userAccessToken, attributes: { name: 'user video' } })
72 } 70 }
73 71
74 { 72 {
75 const videoAttributes = { 73 const attributes = {
76 name: 'my super name for server 1', 74 name: 'my super name for server 1',
77 description: 'my super description for server 1', 75 description: 'my super description for server 1',
78 fixture: 'video_short.webm' 76 fixture: 'video_short.webm'
79 } 77 }
80 const res = await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes) 78 const { id } = await servers[0].videosCommand.upload({ attributes })
81 const videoId = res.body.video.id
82 79
83 await servers[0].commentsCommand.createThread({ videoId, text: 'super comment 1' }) 80 await servers[0].commentsCommand.createThread({ videoId: id, text: 'super comment 1' })
84 await servers[0].commentsCommand.createThread({ videoId, text: 'super comment 2' }) 81 await servers[0].commentsCommand.createThread({ videoId: id, text: 'super comment 2' })
85 } 82 }
86 83
87 { 84 {
88 const videoAttributes = { name: 'unlisted video', privacy: VideoPrivacy.UNLISTED } 85 const attributes = { name: 'unlisted video', privacy: VideoPrivacy.UNLISTED }
89 const res = await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes) 86 const { id } = await servers[0].videosCommand.upload({ attributes })
90 const videoId = res.body.video.id
91 87
92 await servers[0].commentsCommand.createThread({ videoId, text: 'comment on unlisted video' }) 88 await servers[0].commentsCommand.createThread({ videoId: id, text: 'comment on unlisted video' })
93 } 89 }
94 90
95 await waitJobs(servers) 91 await waitJobs(servers)
@@ -218,7 +214,7 @@ describe('Test syndication feeds', () => {
218 it('Should correctly have videos feed with HLS only', async function () { 214 it('Should correctly have videos feed with HLS only', async function () {
219 this.timeout(120000) 215 this.timeout(120000)
220 216
221 await uploadVideo(serverHLSOnly.url, serverHLSOnly.accessToken, { name: 'hls only video' }) 217 await serverHLSOnly.videosCommand.upload({ attributes: { name: 'hls only video' } })
222 218
223 await waitJobs([ serverHLSOnly ]) 219 await waitJobs([ serverHLSOnly ])
224 220
@@ -265,7 +261,7 @@ describe('Test syndication feeds', () => {
265 await servers[1].blocklistCommand.removeFromServerBlocklist({ account: remoteHandle }) 261 await servers[1].blocklistCommand.removeFromServerBlocklist({ account: remoteHandle })
266 262
267 { 263 {
268 const videoUUID = (await uploadVideoAndGetId({ server: servers[1], videoName: 'server 2' })).uuid 264 const videoUUID = (await servers[1].videosCommand.quickUpload({ name: 'server 2' })).uuid
269 await waitJobs(servers) 265 await waitJobs(servers)
270 await servers[0].commentsCommand.createThread({ videoId: videoUUID, text: 'super comment' }) 266 await servers[0].commentsCommand.createThread({ videoId: videoUUID, text: 'super comment' })
271 await waitJobs(servers) 267 await waitJobs(servers)