mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Federate entire description
Introduce an explicit field truncatedDescription description in video list is deprecated description in video get will contain the entire description
This commit is contained in:
@@ -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 { 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 })
|
||||
|
||||
// 30 characters * 6 -> 240 characters
|
||||
const truncatedDescription = 'my super description for server 1'.repeat(7) +
|
||||
'my super descrip...'
|
||||
|
||||
expect(video.description).to.equal(truncatedDescription)
|
||||
expect(video.description).to.equal(longDescription)
|
||||
expect(video.truncatedDescription).to.equal(truncatedDescription)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user