import {
createUser, flushTests, getMyUserInformation, getVideo, getVideosList, immutableAssign, killallServers, makeDeleteRequest,
makeGetRequest, makeUploadRequest, makePutBodyRequest, removeVideo, runServer, ServerInfo, setAccessTokensToServers, userLogin
-} from '../../utils'
-import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
-import { getAccountsList } from '../../utils/users/accounts'
+} from '../../../../shared/utils'
+import {
+ checkBadCountPagination,
+ checkBadSortPagination,
+ checkBadStartPagination
+} from '../../../../shared/utils/requests/check-api-params'
+import { getAccountsList } from '../../../../shared/utils/users/accounts'
const expect = chai.expect
let userAccessToken = ''
let accountName: string
let channelId: number
- let channelUUID: string
+ let channelName: string
let videoId
// ---------------------------------------------------------------
{
const res = await getMyUserInformation(server.url, server.accessToken)
channelId = res.body.videoChannels[ 0 ].id
- channelUUID = res.body.videoChannels[ 0 ].uuid
+ channelName = res.body.videoChannels[ 0 ].name
accountName = res.body.account.name + '@' + res.body.account.host
}
})
let path: string
before(async function () {
- path = '/api/v1/video-channels/' + channelUUID + '/videos'
+ path = '/api/v1/video-channels/' + channelName + '/videos'
})
it('Should fail with a bad start pagination', async function () {
})
it('Should fail with a long support text', async function () {
- const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) })
+ const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
const attaches = baseCorrectAttaches
await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
it('Should fail without an incorrect input file', async function () {
const fields = baseCorrectParams
- const attaches = {
+ let attaches = {
'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short_fake.webm')
}
await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
+
+ attaches = {
+ 'videofile': join(__dirname, '..', '..', 'fixtures', 'video_short.mkv')
+ }
+ await makeUploadRequest({ url: server.url, path: path + '/upload', token: server.accessToken, fields, attaches })
})
it('Should fail with an incorrect thumbnail file', async function () {
})
it('Should fail with a long support text', async function () {
- const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(150) })
+ const fields = immutableAssign(baseCorrectParams, { support: 'super'.repeat(201) })
await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
})