aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-12 11:06:15 +0100
committerChocobozzz <me@florianbigard.com>2018-03-12 11:44:28 +0100
commitb64c950a1cb37da880fc14e8535f438c78b5b7f7 (patch)
tree713bcba3c36e8b13345f0d7134d2e2876265b8e2 /server/tests/utils
parent416c359cb5967c2b5dff0909ef5558a49d753a1a (diff)
downloadPeerTube-b64c950a1cb37da880fc14e8535f438c78b5b7f7.tar.gz
PeerTube-b64c950a1cb37da880fc14e8535f438c78b5b7f7.tar.zst
PeerTube-b64c950a1cb37da880fc14e8535f438c78b5b7f7.zip
Update videos api list for account
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/server/servers.ts4
-rw-r--r--server/tests/utils/videos/videos.ts16
2 files changed, 12 insertions, 8 deletions
diff --git a/server/tests/utils/server/servers.ts b/server/tests/utils/server/servers.ts
index 878efe91a..8373c73ab 100644
--- a/server/tests/utils/server/servers.ts
+++ b/server/tests/utils/server/servers.ts
@@ -24,7 +24,9 @@ interface ServerInfo {
24 id: number 24 id: number
25 uuid: string 25 uuid: string
26 name: string 26 name: string
27 accountName: string 27 account: {
28 name: string
29 }
28 } 30 }
29 31
30 remoteVideo?: { 32 remoteVideo?: {
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts
index a06078d40..4b57f24b5 100644
--- a/server/tests/utils/videos/videos.ts
+++ b/server/tests/utils/videos/videos.ts
@@ -368,8 +368,10 @@ async function completeVideoCheck (
368 commentsEnabled: boolean 368 commentsEnabled: boolean
369 description: string 369 description: string
370 support: string 370 support: string
371 host: string 371 account: {
372 account: string 372 name: string
373 host: string
374 }
373 isLocal: boolean, 375 isLocal: boolean,
374 tags: string[], 376 tags: string[],
375 privacy: number, 377 privacy: number,
@@ -402,8 +404,8 @@ async function completeVideoCheck (
402 expect(video.languageLabel).to.equal(VIDEO_LANGUAGES[attributes.language] || 'Unknown') 404 expect(video.languageLabel).to.equal(VIDEO_LANGUAGES[attributes.language] || 'Unknown')
403 expect(video.nsfw).to.equal(attributes.nsfw) 405 expect(video.nsfw).to.equal(attributes.nsfw)
404 expect(video.description).to.equal(attributes.description) 406 expect(video.description).to.equal(attributes.description)
405 expect(video.serverHost).to.equal(attributes.host) 407 expect(video.account.host).to.equal(attributes.account.host)
406 expect(video.accountName).to.equal(attributes.account) 408 expect(video.account.name).to.equal(attributes.account.name)
407 expect(video.likes).to.equal(attributes.likes) 409 expect(video.likes).to.equal(attributes.likes)
408 expect(video.dislikes).to.equal(attributes.dislikes) 410 expect(video.dislikes).to.equal(attributes.dislikes)
409 expect(video.isLocal).to.equal(attributes.isLocal) 411 expect(video.isLocal).to.equal(attributes.isLocal)
@@ -433,12 +435,12 @@ async function completeVideoCheck (
433 435
434 let extension = extname(attributes.fixture) 436 let extension = extname(attributes.fixture)
435 // Transcoding enabled on server 2, extension will always be .mp4 437 // Transcoding enabled on server 2, extension will always be .mp4
436 if (attributes.host === 'localhost:9002') extension = '.mp4' 438 if (attributes.account.host === 'localhost:9002') extension = '.mp4'
437 439
438 const magnetUri = file.magnetUri 440 const magnetUri = file.magnetUri
439 expect(file.magnetUri).to.have.lengthOf.above(2) 441 expect(file.magnetUri).to.have.lengthOf.above(2)
440 expect(file.torrentUrl).to.equal(`http://${attributes.host}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`) 442 expect(file.torrentUrl).to.equal(`http://${attributes.account.host}/static/torrents/${videoDetails.uuid}-${file.resolution}.torrent`)
441 expect(file.fileUrl).to.equal(`http://${attributes.host}/static/webseed/${videoDetails.uuid}-${file.resolution}${extension}`) 443 expect(file.fileUrl).to.equal(`http://${attributes.account.host}/static/webseed/${videoDetails.uuid}-${file.resolution}${extension}`)
442 expect(file.resolution).to.equal(attributeFile.resolution) 444 expect(file.resolution).to.equal(attributeFile.resolution)
443 expect(file.resolutionLabel).to.equal(attributeFile.resolution + 'p') 445 expect(file.resolutionLabel).to.equal(attributeFile.resolution + 'p')
444 446