diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-14 12:06:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-14 13:03:54 +0100 |
commit | f713f36bdf6f696ab0fe8a309035a09e864a48ca (patch) | |
tree | 3135c3a51fec3f1add56ff0ed559a5c9c499914a /server/tests/api/videos/video-description.ts | |
parent | 44e702ded455c118f9908b70d25e7c7e5512abe9 (diff) | |
download | PeerTube-f713f36bdf6f696ab0fe8a309035a09e864a48ca.tar.gz PeerTube-f713f36bdf6f696ab0fe8a309035a09e864a48ca.tar.zst PeerTube-f713f36bdf6f696ab0fe8a309035a09e864a48ca.zip |
Federate entire description
Introduce an explicit field truncatedDescription
description in video list is deprecated
description in video get will contain the entire description
Diffstat (limited to 'server/tests/api/videos/video-description.ts')
-rw-r--r-- | server/tests/api/videos/video-description.ts | 23 |
1 files changed, 17 insertions, 6 deletions
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 () { | |||
14 | let servers: PeerTubeServer[] = [] | 14 | let servers: PeerTubeServer[] = [] |
15 | let videoUUID = '' | 15 | let videoUUID = '' |
16 | let videoId: number | 16 | let videoId: number |
17 | |||
17 | const longDescription = 'my super description for server 1'.repeat(50) | 18 | const longDescription = 'my super description for server 1'.repeat(50) |
18 | 19 | ||
20 | // 30 characters * 6 -> 240 characters | ||
21 | const truncatedDescription = 'my super description for server 1'.repeat(7) + 'my super descrip...' | ||
22 | |||
19 | before(async function () { | 23 | before(async function () { |
20 | this.timeout(40000) | 24 | this.timeout(40000) |
21 | 25 | ||
@@ -45,15 +49,22 @@ describe('Test video description', function () { | |||
45 | videoUUID = data[0].uuid | 49 | videoUUID = data[0].uuid |
46 | }) | 50 | }) |
47 | 51 | ||
48 | it('Should have a truncated description on each server', async function () { | 52 | it('Should have a truncated description on each server when listing videos', async function () { |
49 | for (const server of servers) { | 53 | for (const server of servers) { |
50 | const video = await server.videos.get({ id: videoUUID }) | 54 | const { data } = await server.videos.list() |
51 | 55 | const video = data.find(v => v.uuid === videoUUID) | |
52 | // 30 characters * 6 -> 240 characters | ||
53 | const truncatedDescription = 'my super description for server 1'.repeat(7) + | ||
54 | 'my super descrip...' | ||
55 | 56 | ||
56 | expect(video.description).to.equal(truncatedDescription) | 57 | expect(video.description).to.equal(truncatedDescription) |
58 | expect(video.truncatedDescription).to.equal(truncatedDescription) | ||
59 | } | ||
60 | }) | ||
61 | |||
62 | it('Should not have a truncated description on each server when getting videos', async function () { | ||
63 | for (const server of servers) { | ||
64 | const video = await server.videos.get({ id: videoUUID }) | ||
65 | |||
66 | expect(video.description).to.equal(longDescription) | ||
67 | expect(video.truncatedDescription).to.equal(truncatedDescription) | ||
57 | } | 68 | } |
58 | }) | 69 | }) |
59 | 70 | ||