diff options
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r-- | server/tests/api/users/users.ts | 23 |
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 | ||