diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-05 09:44:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-05 13:54:30 +0200 |
commit | 8bb71f2e332726c207318e44b95e784f9740dc40 (patch) | |
tree | ee4c271342efec2593f353fa875ea93add6403f5 /server/tests | |
parent | e5c86ba7c2fe5421b0d75943b03282e3f52de270 (diff) | |
download | PeerTube-8bb71f2e332726c207318e44b95e784f9740dc40.tar.gz PeerTube-8bb71f2e332726c207318e44b95e784f9740dc40.tar.zst PeerTube-8bb71f2e332726c207318e44b95e784f9740dc40.zip |
Add auth plugin info in users list
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/plugins/id-and-pass-auth.ts | 16 |
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' |
17 | import { User, UserRole, ServerConfig } from '@shared/models' | 17 | import { User, UserRole, ServerConfig } from '@shared/models' |
18 | import { expect } from 'chai' | 18 | import { 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 | }) |