aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/id-and-pass-auth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins/id-and-pass-auth.ts')
-rw-r--r--server/tests/plugins/id-and-pass-auth.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts
index 97df4c1fd..cbba638c2 100644
--- a/server/tests/plugins/id-and-pass-auth.ts
+++ b/server/tests/plugins/id-and-pass-auth.ts
@@ -12,7 +12,7 @@ import {
12 updateMyUser, 12 updateMyUser,
13 userLogin, 13 userLogin,
14 wait, 14 wait,
15 login, refreshToken, getConfig, updatePluginSettings 15 login, refreshToken, getConfig, updatePluginSettings, getUsersList
16} from '../../../shared/extra-utils' 16} from '../../../shared/extra-utils'
17import { User, UserRole, ServerConfig } from '@shared/models' 17import { User, UserRole, ServerConfig } from '@shared/models'
18import { expect } from 'chai' 18import { expect } from 'chai'
@@ -225,6 +225,20 @@ describe('Test id and pass auth plugins', function () {
225 expect(crashAuth).to.not.exist 225 expect(crashAuth).to.not.exist
226 }) 226 })
227 227
228 it('Should display plugin auth information in users list', async function () {
229 const res = await getUsersList(server.url, server.accessToken)
230
231 const users: User[] = res.body.data
232
233 const root = users.find(u => u.username === 'root')
234 const crash = users.find(u => u.username === 'crash')
235 const laguna = users.find(u => u.username === 'laguna')
236
237 expect(root.pluginAuth).to.be.null
238 expect(crash.pluginAuth).to.equal('peertube-plugin-test-id-pass-auth-one')
239 expect(laguna.pluginAuth).to.equal('peertube-plugin-test-id-pass-auth-two')
240 })
241
228 after(async function () { 242 after(async function () {
229 await cleanupTests([ server ]) 243 await cleanupTests([ server ])
230 }) 244 })