Test video attribute "importedFrom"
This commit is contained in:
parent
4949040b1a
commit
b22e5fceb4
|
@ -202,6 +202,7 @@ describe('Test videos API validator', function () {
|
|||
tags: [ 'tag1', 'tag2' ],
|
||||
privacy: VideoPrivacy.PUBLIC,
|
||||
channelId,
|
||||
importedFrom: 'https://youtu.be/fe8agy1pb44',
|
||||
originallyPublishedAt: new Date().toISOString()
|
||||
}
|
||||
})
|
||||
|
@ -336,6 +337,12 @@ describe('Test videos API validator', function () {
|
|||
await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
|
||||
})
|
||||
|
||||
it('Should fail with a bad URL where the video is imported from', async function () {
|
||||
const fields = { ...baseCorrectParams, importedFrom: 'to' }
|
||||
const attaches = baseCorrectAttaches
|
||||
await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
|
||||
})
|
||||
|
||||
it('Should fail with a bad originally published at attribute', async function () {
|
||||
const fields = { ...baseCorrectParams, originallyPublishedAt: 'toto' }
|
||||
const attaches = baseCorrectAttaches
|
||||
|
@ -590,6 +597,11 @@ describe('Test videos API validator', function () {
|
|||
await makePutBodyRequest({ url: server.url, path: path + video.shortUUID, token: server.accessToken, fields })
|
||||
})
|
||||
|
||||
it('Should fail with a bad URL where the video is imported from', async function () {
|
||||
const fields = { ...baseCorrectParams, importedFrom: 'to' }
|
||||
await makePutBodyRequest({ url: server.url, path: path + video.shortUUID, token: server.accessToken, fields })
|
||||
})
|
||||
|
||||
it('Should fail with a bad originally published at param', async function () {
|
||||
const fields = { ...baseCorrectParams, originallyPublishedAt: 'toto' }
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ async function completeVideoCheck (
|
|||
description: string
|
||||
publishedAt?: string
|
||||
support: string
|
||||
importedFrom?: string
|
||||
originallyPublishedAt?: string
|
||||
account: {
|
||||
name: string
|
||||
|
@ -86,6 +87,12 @@ async function completeVideoCheck (
|
|||
expect(video.publishedAt).to.equal(attributes.publishedAt)
|
||||
}
|
||||
|
||||
if (attributes.importedFrom) {
|
||||
expect(video.importedFrom).to.equal(attributes.importedFrom)
|
||||
} else {
|
||||
expect(video.importedFrom).to.be.null
|
||||
}
|
||||
|
||||
if (attributes.originallyPublishedAt) {
|
||||
expect(video.originallyPublishedAt).to.equal(attributes.originallyPublishedAt)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue