+ it('Should fail with an incorrect thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4'),
+ fixture: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
+ })
+
+ it('Should fail with a big thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png'),
+ fixture: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
+ })
+
+ it('Should fail with an incorrect preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ previewfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4'),
+ fixture: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
+ })
+
+ it('Should fail with a big preview file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ previewfile: join(root(), 'server', 'tests', 'fixtures', 'preview-big.png'),
+ fixture: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await checkUploadVideoParam(server, server.accessToken, { ...fields, ...attaches }, HttpStatusCode.BAD_REQUEST_400, mode)
+ })
+
+ it('Should report the appropriate error', async function () {
+ const fields = { ...baseCorrectParams, language: 'a'.repeat(15) }