+
+ it('Should fail with an incorrect thumbnail file', async function () {
+ const fields = baseCorrectParams
+ const attaches = {
+ thumbnailfile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4'),
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', 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'),
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', 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'),
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', 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'),
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ }
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should succeed with the correct parameters', async function () {
+ this.timeout(10000)
+
+ const fields = baseCorrectParams
+
+ {
+ const attaches = baseCorrectAttaches
+ await makeUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: HttpStatusCode.OK_200
+ })
+ }
+
+ {
+ const attaches = immutableAssign(baseCorrectAttaches, {
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.mp4')
+ })
+
+ await makeUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: HttpStatusCode.OK_200
+ })
+ }
+
+ {
+ const attaches = immutableAssign(baseCorrectAttaches, {
+ videofile: join(root(), 'server', 'tests', 'fixtures', 'video_short.ogv')
+ })
+
+ await makeUploadRequest({
+ url: server.url,
+ path: path + '/upload',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: HttpStatusCode.OK_200
+ })
+ }
+ })