+ it('Should fail with a bad schedule update (miss updateAt)', async function () {
+ const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { privacy: VideoPrivacy.PUBLIC } })
+
+ await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
+ })
+
+ it('Should fail with a bad schedule update (wrong updateAt)', async function () {
+ const fields = immutableAssign(baseCorrectParams, { scheduleUpdate: { updateAt: 'toto', privacy: VideoPrivacy.PUBLIC } })
+
+ await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
+ })
+
+ it('Should fail with a bad originally published at param', async function () {
+ const fields = immutableAssign(baseCorrectParams, { originallyPublishedAt: 'toto' })
+
+ await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
+ })
+
+ it('Should fail with an incorrect thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a big thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with an incorrect preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ previewfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a big preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ previewfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png')
+ }
+
+ await makeUploadRequest({
+ url: server.url,
+ method: 'PUT',
+ path: path + videoId,
+ token: server.accessToken,
+ fields,
+ attaches
+ })
+ })
+
+ it('Should fail with a video of another user without the appropriate right', async function () {
+ const fields = baseCorrectParams
+
+ await makePutBodyRequest({
+ url: server.url,
+ path: path + videoId,
+ token: userAccessToken,
+ fields,
+ statusCodeExpected: HttpStatusCode.FORBIDDEN_403
+ })
+ })