1 /* tslint:disable:no-unused-expression */
4 import * as chai from 'chai'
7 flushAndRunMultipleServers,
14 setAccessTokensToServers,
20 const expect = chai.expect
22 describe('Test video description', function () {
23 let servers: ServerInfo[] = []
25 let longDescription = 'my super description for pod 1'.repeat(50)
27 before(async function () {
31 servers = await flushAndRunMultipleServers(2)
33 // Get the access tokens
34 await setAccessTokensToServers(servers)
36 // Pod 1 makes friend with pod 2
37 await makeFriends(servers[0].url, servers[0].accessToken)
40 it('Should upload video with long description', async function () {
44 description: longDescription
46 await uploadVideo(servers[0].url, servers[0].accessToken, attributes)
50 const res = await getVideosList(servers[0].url)
52 videoUUID = res.body.data[0].uuid
55 it('Should have a truncated description on each pod', async function () {
56 for (const server of servers) {
57 const res = await getVideo(server.url, videoUUID)
58 const video = res.body
60 // 30 characters * 6 -> 240 characters
61 const truncatedDescription = 'my super description for pod 1'.repeat(8) +
64 expect(video.description).to.equal(truncatedDescription)
68 it('Should fetch long description on each pod', async function () {
69 for (const server of servers) {
70 const res = await getVideo(server.url, videoUUID)
71 const video = res.body
73 const res2 = await getVideoDescription(server.url, video.descriptionPath)
74 expect(res2.body.description).to.equal(longDescription)
78 after(async function () {
79 killallServers(servers)
81 // Keep the logs if the test failed