- const res = await getVideoChannelsList(server.url, 0, 1)
- videoChannelId = res.body.data[0].id
+ path = videoChannelPath + '/super_channel'
+ })
+
+ it('Should fail with an incorrect input file', async function () {
+ for (const type of types) {
+ const fields = {}
+ const attaches = {
+ [type + 'file']: buildAbsoluteFixturePath('video_short.mp4')
+ }
+
+ await makeUploadRequest({ url: server.url, path: `${path}/${type}/pick`, token: server.accessToken, fields, attaches })
+ }
+ })
+
+ it('Should fail with a big file', async function () {
+ for (const type of types) {
+ const fields = {}
+ const attaches = {
+ [type + 'file']: buildAbsoluteFixturePath('avatar-big.png')
+ }
+ await makeUploadRequest({ url: server.url, path: `${path}/${type}/pick`, token: server.accessToken, fields, attaches })
+ }
+ })
+
+ it('Should fail with an unauthenticated user', async function () {
+ for (const type of types) {
+ const fields = {}
+ const attaches = {
+ [type + 'file']: buildAbsoluteFixturePath('avatar.png')
+ }
+ await makeUploadRequest({
+ url: server.url,
+ path: `${path}/${type}/pick`,
+ fields,
+ attaches,
+ statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401
+ })
+ }