aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/tests/src/feeds/feeds.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-10-03 12:20:11 +0200
committerChocobozzz <me@florianbigard.com>2023-10-03 12:20:11 +0200
commit1611721c9b9bb00015730259fd91dfd6c5aed824 (patch)
treebfbb4e05b558ce44fb4c721072a9eb5ec50db494 /packages/tests/src/feeds/feeds.ts
parent5cea8f956721038e280695aae1390198c0b8a1e1 (diff)
downloadPeerTube-develop.tar.gz
PeerTube-develop.tar.zst
PeerTube-develop.zip
Fix feed audio file mimetypedevelop
Diffstat (limited to 'packages/tests/src/feeds/feeds.ts')
-rw-r--r--packages/tests/src/feeds/feeds.ts32
1 files changed, 23 insertions, 9 deletions
diff --git a/packages/tests/src/feeds/feeds.ts b/packages/tests/src/feeds/feeds.ts
index 7587bb34e..ed833ffd1 100644
--- a/packages/tests/src/feeds/feeds.ts
+++ b/packages/tests/src/feeds/feeds.ts
@@ -46,13 +46,7 @@ describe('Test syndication feeds', () => {
46 46
47 // Run servers 47 // Run servers
48 servers = await createMultipleServers(2) 48 servers = await createMultipleServers(2)
49 serverHLSOnly = await createSingleServer(3, { 49 serverHLSOnly = await createSingleServer(3)
50 transcoding: {
51 enabled: true,
52 web_videos: { enabled: false },
53 hls: { enabled: true }
54 }
55 })
56 50
57 await setAccessTokensToServers([ ...servers, serverHLSOnly ]) 51 await setAccessTokensToServers([ ...servers, serverHLSOnly ])
58 await setDefaultChannelAvatar(servers[0]) 52 await setDefaultChannelAvatar(servers[0])
@@ -60,6 +54,7 @@ describe('Test syndication feeds', () => {
60 await doubleFollow(servers[0], servers[1]) 54 await doubleFollow(servers[0], servers[1])
61 55
62 await servers[0].config.enableLive({ allowReplay: false, transcoding: false }) 56 await servers[0].config.enableLive({ allowReplay: false, transcoding: false })
57 await serverHLSOnly.config.enableTranscoding({ webVideo: false, hls: true, with0p: true })
63 58
64 { 59 {
65 const user = await servers[0].users.getMyInfo() 60 const user = await servers[0].users.getMyInfo()
@@ -397,9 +392,9 @@ describe('Test syndication feeds', () => {
397 const jsonObj = JSON.parse(json) 392 const jsonObj = JSON.parse(json)
398 expect(jsonObj.items.length).to.be.equal(1) 393 expect(jsonObj.items.length).to.be.equal(1)
399 expect(jsonObj.items[0].attachments).to.exist 394 expect(jsonObj.items[0].attachments).to.exist
400 expect(jsonObj.items[0].attachments.length).to.be.eq(4) 395 expect(jsonObj.items[0].attachments.length).to.be.eq(6)
401 396
402 for (let i = 0; i < 4; i++) { 397 for (let i = 0; i < 6; i++) {
403 expect(jsonObj.items[0].attachments[i].mime_type).to.be.eq('application/x-bittorrent') 398 expect(jsonObj.items[0].attachments[i].mime_type).to.be.eq('application/x-bittorrent')
404 expect(jsonObj.items[0].attachments[i].size_in_bytes).to.be.greaterThan(0) 399 expect(jsonObj.items[0].attachments[i].size_in_bytes).to.be.greaterThan(0)
405 expect(jsonObj.items[0].attachments[i].url).to.exist 400 expect(jsonObj.items[0].attachments[i].url).to.exist
@@ -450,6 +445,25 @@ describe('Test syndication feeds', () => {
450 await makeRawRequest({ url: imageUrl, expectedStatus: HttpStatusCode.OK_200 }) 445 await makeRawRequest({ url: imageUrl, expectedStatus: HttpStatusCode.OK_200 })
451 }) 446 })
452 }) 447 })
448
449 describe('XML feed', function () {
450
451 it('Should correctly have video mime types feed with HLS only', async function () {
452 this.timeout(120000)
453
454 const rss = await serverHLSOnly.feed.getXML({ feed: 'videos', ignoreCache: true })
455 const parser = new XMLParser({ parseAttributeValue: true, ignoreAttributes: false })
456 const xmlDoc = parser.parse(rss)
457
458 for (const media of xmlDoc.rss.channel.item['media:group']['media:content']) {
459 if (media['@_height'] === 0) {
460 expect(media['@_type']).to.equal('audio/mp4')
461 } else {
462 expect(media['@_type']).to.equal('video/mp4')
463 }
464 }
465 })
466 })
453 }) 467 })
454 468
455 describe('Video comments feed', function () { 469 describe('Video comments feed', function () {