diff options
Diffstat (limited to 'server/tests/api')
-rw-r--r-- | server/tests/api/check-params/users.ts | 9 | ||||
-rw-r--r-- | server/tests/api/users/users.ts | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index ec46609a4..273be1679 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -428,6 +428,14 @@ describe('Test users API validators', function () { | |||
428 | await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) | 428 | await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) |
429 | }) | 429 | }) |
430 | 430 | ||
431 | it('Should fail with an invalid emailVerified attribute', async function () { | ||
432 | const fields = { | ||
433 | emailVerified: 'yes' | ||
434 | } | ||
435 | |||
436 | await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields }) | ||
437 | }) | ||
438 | |||
431 | it('Should fail with an invalid videoQuota attribute', async function () { | 439 | it('Should fail with an invalid videoQuota attribute', async function () { |
432 | const fields = { | 440 | const fields = { |
433 | videoQuota: -90 | 441 | videoQuota: -90 |
@@ -463,6 +471,7 @@ describe('Test users API validators', function () { | |||
463 | it('Should succeed with the correct params', async function () { | 471 | it('Should succeed with the correct params', async function () { |
464 | const fields = { | 472 | const fields = { |
465 | email: 'email@example.com', | 473 | email: 'email@example.com', |
474 | emailVerified: true, | ||
466 | videoQuota: 42, | 475 | videoQuota: 42, |
467 | role: UserRole.MODERATOR | 476 | role: UserRole.MODERATOR |
468 | } | 477 | } |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 513bca8a0..e7bb845b9 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -478,6 +478,7 @@ describe('Test users', function () { | |||
478 | userId, | 478 | userId, |
479 | accessToken, | 479 | accessToken, |
480 | email: 'updated2@example.com', | 480 | email: 'updated2@example.com', |
481 | emailVerified: true, | ||
481 | videoQuota: 42, | 482 | videoQuota: 42, |
482 | role: UserRole.MODERATOR | 483 | role: UserRole.MODERATOR |
483 | }) | 484 | }) |
@@ -487,6 +488,7 @@ describe('Test users', function () { | |||
487 | 488 | ||
488 | expect(user.username).to.equal('user_1') | 489 | expect(user.username).to.equal('user_1') |
489 | expect(user.email).to.equal('updated2@example.com') | 490 | expect(user.email).to.equal('updated2@example.com') |
491 | expect(user.emailVerified).to.be.true | ||
490 | expect(user.nsfwPolicy).to.equal('do_not_list') | 492 | expect(user.nsfwPolicy).to.equal('do_not_list') |
491 | expect(user.videoQuota).to.equal(42) | 493 | expect(user.videoQuota).to.equal(42) |
492 | expect(user.roleLabel).to.equal('Moderator') | 494 | expect(user.roleLabel).to.equal('Moderator') |