+ })
+
+ it('Should fail with nothing', async function () {
+ const fields = {}
+ const attaches = {}
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should fail without name', async function () {
+ const fields = omit(baseCorrectParams, 'name')
+ const attaches = baseCorrectAttaches
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should fail with a long name', async function () {
+ const fields = immutableAssign(baseCorrectParams, { name: 'super'.repeat(65) })
+ const attaches = baseCorrectAttaches
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should fail with a bad category', async function () {
+ const fields = immutableAssign(baseCorrectParams, { category: 125 })
+ const attaches = baseCorrectAttaches
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should fail with a bad licence', async function () {
+ const fields = immutableAssign(baseCorrectParams, { licence: 125 })
+ const attaches = baseCorrectAttaches
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+ })
+
+ it('Should fail with a bad language', async function () {
+ const fields = immutableAssign(baseCorrectParams, { language: 'a'.repeat(15) })
+ const attaches = baseCorrectAttaches
+
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })