aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-07 16:59:53 +0200
committerChocobozzz <me@florianbigard.com>2019-06-07 17:05:42 +0200
commit1f20622f2b087eaf8738d60fae00a44b9c558ca3 (patch)
tree1c8554623665ca96b8a1e6f2a6bcb8c1b5a83c2e /server/tests/api/users
parent1a03bea0c42fa1064ce4770157b4fd2e3edd5565 (diff)
downloadPeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.gz
PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.tar.zst
PeerTube-1f20622f2b087eaf8738d60fae00a44b9c558ca3.zip
Improve registration
* Add ability to set the user display name * Use display name to guess the username/channel name * Add explanations about what is the purpose of a username/channel name * Add a loader at the "done" step
Diffstat (limited to 'server/tests/api/users')
-rw-r--r--server/tests/api/users/users.ts15
1 files changed, 11 insertions, 4 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index 9d2ef786f..b1f214fe2 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -17,11 +17,12 @@ import {
17 getUserInformation, 17 getUserInformation,
18 getUsersList, 18 getUsersList,
19 getUsersListPaginationAndSort, 19 getUsersListPaginationAndSort,
20 getVideoChannel,
20 getVideosList, 21 getVideosList,
21 login, 22 login,
22 makePutBodyRequest, 23 makePutBodyRequest,
23 rateVideo, 24 rateVideo,
24 registerUser, 25 registerUserWithChannel,
25 removeUser, 26 removeUser,
26 removeVideo, 27 removeVideo,
27 ServerInfo, 28 ServerInfo,
@@ -31,8 +32,7 @@ import {
31 updateMyUser, 32 updateMyUser,
32 updateUser, 33 updateUser,
33 uploadVideo, 34 uploadVideo,
34 userLogin, 35 userLogin
35 registerUserWithChannel, getVideoChannel
36} from '../../../../shared/extra-utils' 36} from '../../../../shared/extra-utils'
37import { follow } from '../../../../shared/extra-utils/server/follows' 37import { follow } from '../../../../shared/extra-utils/server/follows'
38import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login' 38import { setAccessTokensToServers } from '../../../../shared/extra-utils/users/login'
@@ -618,7 +618,7 @@ describe('Test users', function () {
618 618
619 describe('Registering a new user', function () { 619 describe('Registering a new user', function () {
620 it('Should register a new user', async function () { 620 it('Should register a new user', async function () {
621 const user = { username: 'user_15', password: 'my super password' } 621 const user = { displayName: 'super user 15', username: 'user_15', password: 'my super password' }
622 const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' } 622 const channel = { name: 'my_user_15_channel', displayName: 'my channel rocks' }
623 623
624 await registerUserWithChannel({ url: server.url, user, channel }) 624 await registerUserWithChannel({ url: server.url, user, channel })
@@ -633,6 +633,13 @@ describe('Test users', function () {
633 accessToken = await userLogin(server, user15) 633 accessToken = await userLogin(server, user15)
634 }) 634 })
635 635
636 it('Should have the correct display name', async function () {
637 const res = await getMyUserInformation(server.url, accessToken)
638 const user: User = res.body
639
640 expect(user.account.displayName).to.equal('super user 15')
641 })
642
636 it('Should have the correct video quota', async function () { 643 it('Should have the correct video quota', async function () {
637 const res = await getMyUserInformation(server.url, accessToken) 644 const res = await getMyUserInformation(server.url, accessToken)
638 const user = res.body 645 const user = res.body