diff options
-rw-r--r-- | server/tests/feeds/feeds.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/server/tests/feeds/feeds.ts b/server/tests/feeds/feeds.ts index 320dc3333..ba3292a94 100644 --- a/server/tests/feeds/feeds.ts +++ b/server/tests/feeds/feeds.ts | |||
@@ -13,6 +13,7 @@ import { | |||
13 | PeerTubeServer, | 13 | PeerTubeServer, |
14 | setAccessTokensToServers, | 14 | setAccessTokensToServers, |
15 | setDefaultChannelAvatar, | 15 | setDefaultChannelAvatar, |
16 | stopFfmpeg, | ||
16 | waitJobs | 17 | waitJobs |
17 | } from '@shared/server-commands' | 18 | } from '@shared/server-commands' |
18 | 19 | ||
@@ -30,6 +31,7 @@ describe('Test syndication feeds', () => { | |||
30 | let userAccountId: number | 31 | let userAccountId: number |
31 | let userChannelId: number | 32 | let userChannelId: number |
32 | let userFeedToken: string | 33 | let userFeedToken: string |
34 | let liveId: string | ||
33 | 35 | ||
34 | before(async function () { | 36 | before(async function () { |
35 | this.timeout(120000) | 37 | this.timeout(120000) |
@@ -48,6 +50,8 @@ describe('Test syndication feeds', () => { | |||
48 | await setDefaultChannelAvatar(servers[0]) | 50 | await setDefaultChannelAvatar(servers[0]) |
49 | await doubleFollow(servers[0], servers[1]) | 51 | await doubleFollow(servers[0], servers[1]) |
50 | 52 | ||
53 | await servers[0].config.enableLive({ allowReplay: false, transcoding: false }) | ||
54 | |||
51 | { | 55 | { |
52 | const user = await servers[0].users.getMyInfo() | 56 | const user = await servers[0].users.getMyInfo() |
53 | rootAccountId = user.account.id | 57 | rootAccountId = user.account.id |
@@ -267,6 +271,41 @@ describe('Test syndication feeds', () => { | |||
267 | expect(jsonObj.items[0].attachments[i].url).to.exist | 271 | expect(jsonObj.items[0].attachments[i].url).to.exist |
268 | } | 272 | } |
269 | }) | 273 | }) |
274 | |||
275 | it('Should not display waiting live videos', async function () { | ||
276 | const { uuid } = await servers[0].live.create({ | ||
277 | fields: { | ||
278 | name: 'live', | ||
279 | privacy: VideoPrivacy.PUBLIC, | ||
280 | channelId: rootChannelId | ||
281 | } | ||
282 | }) | ||
283 | liveId = uuid | ||
284 | |||
285 | const json = await servers[0].feed.getJSON({ feed: 'videos' }) | ||
286 | |||
287 | const jsonObj = JSON.parse(json) | ||
288 | expect(jsonObj.items.length).to.be.equal(2) | ||
289 | expect(jsonObj.items[0].title).to.equal('my super name for server 1') | ||
290 | expect(jsonObj.items[1].title).to.equal('user video') | ||
291 | }) | ||
292 | |||
293 | it('Should not display published live videos', async function () { | ||
294 | this.timeout(120000) | ||
295 | |||
296 | const ffmpeg = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveId, copyCodecs: true, fixtureName: 'video_short.mp4' }) | ||
297 | await servers[0].live.waitUntilPublished({ videoId: liveId }) | ||
298 | |||
299 | const json = await servers[0].feed.getJSON({ feed: 'videos' }) | ||
300 | |||
301 | const jsonObj = JSON.parse(json) | ||
302 | expect(jsonObj.items.length).to.be.equal(3) | ||
303 | expect(jsonObj.items[0].title).to.equal('my super name for server 1') | ||
304 | expect(jsonObj.items[1].title).to.equal('user video') | ||
305 | expect(jsonObj.items[2].title).to.equal('live video') | ||
306 | |||
307 | await stopFfmpeg(ffmpeg) | ||
308 | }) | ||
270 | }) | 309 | }) |
271 | 310 | ||
272 | describe('Video comments feed', function () { | 311 | describe('Video comments feed', function () { |