updateVideoAbuse,
uploadVideo,
userLogin
-} from '../../../../shared/utils'
+} from '../../../../shared/extra-utils'
import {
checkBadCountPagination,
checkBadSortPagination,
checkBadStartPagination
-} from '../../../../shared/utils/requests/check-api-params'
+} from '../../../../shared/extra-utils/requests/check-api-params'
import { VideoAbuseState } from '../../../../shared/models/videos'
describe('Test video abuses API validators', function () {
const username = 'user1'
const password = 'my super password'
- await createUser(server.url, server.accessToken, username, password)
+ await createUser({ url: server.url, accessToken: server.accessToken, username: username, password: password })
userAccessToken = await userLogin(server, { username, password })
const res = await uploadVideo(server.url, server.accessToken, {})
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
})
- it('Should fail with a reason too big', async function () {
- const fields = { reason: 'super'.repeat(61) }
+ it('Should fail with a too big reason', async function () {
+ const fields = { reason: 'super'.repeat(605) }
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
})
})
it('Should fail with a bad moderation comment', async function () {
- const body = { moderationComment: 'b'.repeat(305) }
+ const body = { moderationComment: 'b'.repeat(3001) }
await updateVideoAbuse(server.url, server.accessToken, server.video.uuid, videoAbuseId, body, 400)
})