X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-description.ts;h=c4185882a3d1b167a3fa3901578942a3f7751d62;hb=b1dbb9fefc870a90b25f5c0153589f45c9e75e3e;hp=a4b3ff6e73006e0c5e2465150ad0c0b718f4e7a6;hpb=3c4754a3a16939337bfeb90c375fbb9e0f7d91fb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-description.ts b/server/tests/api/videos/video-description.ts index a4b3ff6e7..c4185882a 100644 --- a/server/tests/api/videos/video-description.ts +++ b/server/tests/api/videos/video-description.ts @@ -14,8 +14,12 @@ describe('Test video description', function () { let servers: PeerTubeServer[] = [] let videoUUID = '' let videoId: number + const longDescription = 'my super description for server 1'.repeat(50) + // 30 characters * 6 -> 240 characters + const truncatedDescription = 'my super description for server 1'.repeat(7) + 'my super descrip...' + before(async function () { this.timeout(40000) @@ -45,15 +49,22 @@ describe('Test video description', function () { videoUUID = data[0].uuid }) - it('Should have a truncated description on each server', async function () { + it('Should have a truncated description on each server when listing videos', async function () { for (const server of servers) { - const video = await server.videos.get({ id: videoUUID }) - - // 30 characters * 6 -> 240 characters - const truncatedDescription = 'my super description for server 1'.repeat(7) + - 'my super descrip...' + const { data } = await server.videos.list() + const video = data.find(v => v.uuid === videoUUID) expect(video.description).to.equal(truncatedDescription) + expect(video.truncatedDescription).to.equal(truncatedDescription) + } + }) + + it('Should not have a truncated description on each server when getting videos', async function () { + for (const server of servers) { + const video = await server.videos.get({ id: videoUUID }) + + expect(video.description).to.equal(longDescription) + expect(video.truncatedDescription).to.equal(truncatedDescription) } })