aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-01 15:39:13 +0100
committerChocobozzz <me@florianbigard.com>2021-02-01 15:39:13 +0100
commit6d989edc66e7b541fcf97c2a4a6f91cbf960060a (patch)
tree9c72977cf05eee2b3a84dd1867ec60ef491b0900 /server/tests/api/users
parentcb5c2abc99c2e222fe18621f79cb68b805678e15 (diff)
downloadPeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.tar.gz
PeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.tar.zst
PeerTube-6d989edc66e7b541fcf97c2a4a6f91cbf960060a.zip
Add ability to update plugin auth
Diffstat (limited to 'server/tests/api/users')
-rw-r--r--server/tests/api/users/users.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index cd928b980..62a59033f 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -716,11 +716,12 @@ describe('Test users', function () {
716 emailVerified: true, 716 emailVerified: true,
717 videoQuota: 42, 717 videoQuota: 42,
718 role: UserRole.MODERATOR, 718 role: UserRole.MODERATOR,
719 adminFlags: UserAdminFlag.NONE 719 adminFlags: UserAdminFlag.NONE,
720 pluginAuth: 'toto'
720 }) 721 })
721 722
722 const res = await getUserInformation(server.url, accessToken, userId) 723 const res = await getUserInformation(server.url, accessToken, userId)
723 const user = res.body 724 const user = res.body as User
724 725
725 expect(user.username).to.equal('user_1') 726 expect(user.username).to.equal('user_1')
726 expect(user.email).to.equal('updated2@example.com') 727 expect(user.email).to.equal('updated2@example.com')
@@ -730,6 +731,15 @@ describe('Test users', function () {
730 expect(user.roleLabel).to.equal('Moderator') 731 expect(user.roleLabel).to.equal('Moderator')
731 expect(user.id).to.be.a('number') 732 expect(user.id).to.be.a('number')
732 expect(user.adminFlags).to.equal(UserAdminFlag.NONE) 733 expect(user.adminFlags).to.equal(UserAdminFlag.NONE)
734 expect(user.pluginAuth).to.equal('toto')
735 })
736
737 it('Should reset the auth plugin', async function () {
738 await updateUser({ url: server.url, userId, accessToken, pluginAuth: null })
739
740 const res = await getUserInformation(server.url, accessToken, userId)
741 const user = res.body as User
742 expect(user.pluginAuth).to.be.null
733 }) 743 })
734 744
735 it('Should have removed the user token', async function () { 745 it('Should have removed the user token', async function () {