diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-15 10:02:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch) | |
tree | da82286d423c5e834a1ee2dcd5970076b8263cf1 /server/tests/feeds/feeds.ts | |
parent | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff) | |
download | PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip |
Introduce videos command
Diffstat (limited to 'server/tests/feeds/feeds.ts')
-rw-r--r-- | server/tests/feeds/feeds.ts | 24 |
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' |
18 | import { VideoPrivacy } from '@shared/models' | 16 | import { 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) |