aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-26 10:03:40 +0200
committerChocobozzz <me@florianbigard.com>2018-04-26 10:03:40 +0200
commited56ad1193bb5bb0a81fb843a11eb90d3fed9861 (patch)
tree64842447b4721978c69e1d2b3a964951c789c408 /server/tests/api/users/users.ts
parentd62cf3234ccfca0223a9639782635f0fb6594f8c (diff)
downloadPeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.tar.gz
PeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.tar.zst
PeerTube-ed56ad1193bb5bb0a81fb843a11eb90d3fed9861.zip
Add ability to update the user display name/description
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index 1192ef9e4..1ea599859 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -172,6 +172,7 @@ describe('Test users', function () {
172 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 172 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
173 expect(user.roleLabel).to.equal('User') 173 expect(user.roleLabel).to.equal('User')
174 expect(user.id).to.be.a('number') 174 expect(user.id).to.be.a('number')
175 expect(user.account.displayName).to.equal('user_1')
175 expect(user.account.description).to.be.null 176 expect(user.account.description).to.be.null
176 }) 177 })
177 178
@@ -316,6 +317,7 @@ describe('Test users', function () {
316 expect(user.nsfwPolicy).to.equal('do_not_list') 317 expect(user.nsfwPolicy).to.equal('do_not_list')
317 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 318 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
318 expect(user.id).to.be.a('number') 319 expect(user.id).to.be.a('number')
320 expect(user.account.displayName).to.equal('user_1')
319 expect(user.account.description).to.be.null 321 expect(user.account.description).to.be.null
320 }) 322 })
321 323
@@ -347,6 +349,7 @@ describe('Test users', function () {
347 expect(user.nsfwPolicy).to.equal('do_not_list') 349 expect(user.nsfwPolicy).to.equal('do_not_list')
348 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 350 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
349 expect(user.id).to.be.a('number') 351 expect(user.id).to.be.a('number')
352 expect(user.account.displayName).to.equal('user_1')
350 expect(user.account.description).to.be.null 353 expect(user.account.description).to.be.null
351 }) 354 })
352 355
@@ -365,6 +368,25 @@ describe('Test users', function () {
365 await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png') 368 await testImage(server.url, 'avatar-resized', user.account.avatar.path, '.png')
366 }) 369 })
367 370
371 it('Should be able to update my display name', async function () {
372 await updateMyUser({
373 url: server.url,
374 accessToken: accessTokenUser,
375 displayName: 'new display name'
376 })
377
378 const res = await getMyUserInformation(server.url, accessTokenUser)
379 const user = res.body
380
381 expect(user.username).to.equal('user_1')
382 expect(user.email).to.equal('updated@example.com')
383 expect(user.nsfwPolicy).to.equal('do_not_list')
384 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
385 expect(user.id).to.be.a('number')
386 expect(user.account.displayName).to.equal('new display name')
387 expect(user.account.description).to.be.null
388 })
389
368 it('Should be able to update my description', async function () { 390 it('Should be able to update my description', async function () {
369 await updateMyUser({ 391 await updateMyUser({
370 url: server.url, 392 url: server.url,
@@ -380,6 +402,7 @@ describe('Test users', function () {
380 expect(user.nsfwPolicy).to.equal('do_not_list') 402 expect(user.nsfwPolicy).to.equal('do_not_list')
381 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 403 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
382 expect(user.id).to.be.a('number') 404 expect(user.id).to.be.a('number')
405 expect(user.account.displayName).to.equal('new display name')
383 expect(user.account.description).to.equal('my super description updated') 406 expect(user.account.description).to.equal('my super description updated')
384 }) 407 })
385 408