aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-19 12:36:41 +0100
committerChocobozzz <me@florianbigard.com>2018-03-19 14:20:04 +0100
commit5d00a3d7aa4309f1da5ac7d6e3ed63181eb34952 (patch)
tree924c46daaac9ef56108d8c449f934b6de344ae72 /server/tests
parent09700934b90e2ac7b1b9ed1694d9d4d52735e2e1 (diff)
downloadPeerTube-5d00a3d7aa4309f1da5ac7d6e3ed63181eb34952.tar.gz
PeerTube-5d00a3d7aa4309f1da5ac7d6e3ed63181eb34952.tar.zst
PeerTube-5d00a3d7aa4309f1da5ac7d6e3ed63181eb34952.zip
Update the api documentation
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/videos/multiple-servers.ts9
-rw-r--r--server/tests/cli/update-host.ts5
-rw-r--r--server/tests/utils/videos/videos.ts6
3 files changed, 10 insertions, 10 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 42a1241f7..74c6b8462 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -452,7 +452,7 @@ describe('Test multiple servers', function () {
452 const res2 = await getVideo(servers[0].url, video.id) 452 const res2 = await getVideo(servers[0].url, video.id)
453 const videoDetails = res2.body 453 const videoDetails = res2.body
454 454
455 const file = videoDetails.files.find(f => f.resolution === 360) 455 const file = videoDetails.files.find(f => f.resolution.id === 360)
456 expect(file).not.to.be.undefined 456 expect(file).not.to.be.undefined
457 457
458 const torrent = await webtorrentAdd(file.magnetUri) 458 const torrent = await webtorrentAdd(file.magnetUri)
@@ -705,10 +705,9 @@ describe('Test multiple servers', function () {
705 705
706 expect(baseVideo.name).to.equal(video.name) 706 expect(baseVideo.name).to.equal(video.name)
707 expect(baseVideo.uuid).to.equal(video.uuid) 707 expect(baseVideo.uuid).to.equal(video.uuid)
708 expect(baseVideo.category).to.equal(video.category) 708 expect(baseVideo.category.id).to.equal(video.category.id)
709 expect(baseVideo.language).to.equal(video.language) 709 expect(baseVideo.language.id).to.equal(video.language.id)
710 expect(baseVideo.licence).to.equal(video.licence) 710 expect(baseVideo.licence.id).to.equal(video.licence.id)
711 expect(baseVideo.category).to.equal(video.category)
712 expect(baseVideo.nsfw).to.equal(video.nsfw) 711 expect(baseVideo.nsfw).to.equal(video.nsfw)
713 expect(baseVideo.account.name).to.equal(video.account.name) 712 expect(baseVideo.account.name).to.equal(video.account.name)
714 expect(baseVideo.account.displayName).to.equal(video.account.displayName) 713 expect(baseVideo.account.displayName).to.equal(video.account.displayName)
diff --git a/server/tests/cli/update-host.ts b/server/tests/cli/update-host.ts
index 39242c494..ad56f7b1b 100644
--- a/server/tests/cli/update-host.ts
+++ b/server/tests/cli/update-host.ts
@@ -2,6 +2,7 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { VideoDetails } from '../../../shared/models/videos'
5const expect = chai.expect 6const expect = chai.expect
6 7
7import { 8import {
@@ -59,7 +60,7 @@ describe('Test update host scripts', function () {
59 60
60 for (const video of videos) { 61 for (const video of videos) {
61 const res2 = await getVideo(server.url, video.id) 62 const res2 = await getVideo(server.url, video.id)
62 const videoDetails = res2.body 63 const videoDetails: VideoDetails = res2.body
63 64
64 expect(videoDetails.files).to.have.lengthOf(4) 65 expect(videoDetails.files).to.have.lengthOf(4)
65 66
@@ -67,7 +68,7 @@ describe('Test update host scripts', function () {
67 expect(file.magnetUri).to.contain('localhost%3A9002%2Ftracker%2Fsocket') 68 expect(file.magnetUri).to.contain('localhost%3A9002%2Ftracker%2Fsocket')
68 expect(file.magnetUri).to.contain('localhost%3A9002%2Fstatic%2Fwebseed%2F') 69 expect(file.magnetUri).to.contain('localhost%3A9002%2Fstatic%2Fwebseed%2F')
69 70
70 const torrent = await parseTorrentVideo(server, videoDetails.uuid, file.resolution) 71 const torrent = await parseTorrentVideo(server, videoDetails.uuid, file.resolution.id)
71 const announceWS = torrent.announce.find(a => a === 'ws://localhost:9002/tracker/socket') 72 const announceWS = torrent.announce.find(a => a === 'ws://localhost:9002/tracker/socket')
72 expect(announceWS).to.not.be.undefined 73 expect(announceWS).to.not.be.undefined
73 74
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index 3c63bedb2..424f41ed8 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -442,7 +442,7 @@ async function completeVideoCheck (
442 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true 442 expect(dateIsValid(videoDetails.channel.updatedAt)).to.be.true
443 443
444 for (const attributeFile of attributes.files) { 444 for (const attributeFile of attributes.files) {
445 const file = videoDetails.files.find(f => f.resolution === attributeFile.resolution) 445 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)
446 expect(file).not.to.be.undefined 446 expect(file).not.to.be.undefined
447 447
448 let extension = extname(attributes.fixture) 448 let extension = extname(attributes.fixture)
@@ -451,8 +451,8 @@ async function completeVideoCheck (
451 451
452 const magnetUri = file.magnetUri 452 const magnetUri = file.magnetUri
453 expect(file.magnetUri).to.have.lengthOf.above(2) 453 expect(file.magnetUri).to.have.lengthOf.above(2)
454 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`) 454 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution.id}.torrent`)
455 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution}${extension}`) 455 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution.id}${extension}`)
456 expect(file.resolution.id).to.equal(attributeFile.resolution) 456 expect(file.resolution.id).to.equal(attributeFile.resolution)
457 expect(file.resolution.label).to.equal(attributeFile.resolution + 'p') 457 expect(file.resolution.label).to.equal(attributeFile.resolution + 'p')
458 458