mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Begin to add avatar to actors
This commit is contained in:
parent
8b0d42ee37
commit
c5911fd347
41 changed files with 498 additions and 177 deletions
|
@ -2,11 +2,13 @@
|
|||
|
||||
import { omit } from 'lodash'
|
||||
import 'mocha'
|
||||
import { join } from "path"
|
||||
import { UserRole } from '../../../../shared'
|
||||
|
||||
import {
|
||||
createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
|
||||
makePostBodyRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers, updateUser,
|
||||
makePostBodyRequest, makePostUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers,
|
||||
updateUser,
|
||||
uploadVideo, userLogin
|
||||
} from '../../utils'
|
||||
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
|
||||
|
@ -266,6 +268,24 @@ describe('Test users API validators', function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe('When updating my avatar', function () {
|
||||
it('Should fail without an incorrect input file', async function () {
|
||||
const fields = {}
|
||||
const attaches = {
|
||||
'avatarfile': join(__dirname, '..', 'fixtures', 'video_short.mp4')
|
||||
}
|
||||
await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
|
||||
})
|
||||
|
||||
it('Should succeed with the correct params', async function () {
|
||||
const fields = {}
|
||||
const attaches = {
|
||||
'avatarfile': join(__dirname, '..', 'fixtures', 'avatar.png')
|
||||
}
|
||||
await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
|
||||
})
|
||||
})
|
||||
|
||||
describe('When updating a user', function () {
|
||||
|
||||
before(async function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue