aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/external-plugins/auth-ldap.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/external-plugins/auth-ldap.ts')
-rw-r--r--server/tests/external-plugins/auth-ldap.ts28
1 files changed, 5 insertions, 23 deletions
diff --git a/server/tests/external-plugins/auth-ldap.ts b/server/tests/external-plugins/auth-ldap.ts
index e4eae7e8c..0d4edbee0 100644
--- a/server/tests/external-plugins/auth-ldap.ts
+++ b/server/tests/external-plugins/auth-ldap.ts
@@ -3,17 +3,7 @@
3import 'mocha' 3import 'mocha'
4import { expect } from 'chai' 4import { expect } from 'chai'
5import { User } from '@shared/models/users/user.model' 5import { User } from '@shared/models/users/user.model'
6import { 6import { blockUser, getMyUserInformation, setAccessTokensToServers, unblockUser, uploadVideo, userLogin } from '../../../shared/extra-utils'
7 blockUser,
8 getMyUserInformation,
9 installPlugin,
10 setAccessTokensToServers,
11 unblockUser,
12 uninstallPlugin,
13 updatePluginSettings,
14 uploadVideo,
15 userLogin
16} from '../../../shared/extra-utils'
17import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers' 7import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers'
18 8
19describe('Official plugin auth-ldap', function () { 9describe('Official plugin auth-ldap', function () {
@@ -27,11 +17,7 @@ describe('Official plugin auth-ldap', function () {
27 server = await flushAndRunServer(1) 17 server = await flushAndRunServer(1)
28 await setAccessTokensToServers([ server ]) 18 await setAccessTokensToServers([ server ])
29 19
30 await installPlugin({ 20 await server.pluginsCommand.install({ npmName: 'peertube-plugin-auth-ldap' })
31 url: server.url,
32 accessToken: server.accessToken,
33 npmName: 'peertube-plugin-auth-ldap'
34 })
35 }) 21 })
36 22
37 it('Should not login with without LDAP settings', async function () { 23 it('Should not login with without LDAP settings', async function () {
@@ -39,9 +25,7 @@ describe('Official plugin auth-ldap', function () {
39 }) 25 })
40 26
41 it('Should not login with bad LDAP settings', async function () { 27 it('Should not login with bad LDAP settings', async function () {
42 await updatePluginSettings({ 28 await server.pluginsCommand.updateSettings({
43 url: server.url,
44 accessToken: server.accessToken,
45 npmName: 'peertube-plugin-auth-ldap', 29 npmName: 'peertube-plugin-auth-ldap',
46 settings: { 30 settings: {
47 'bind-credentials': 'GoodNewsEveryone', 31 'bind-credentials': 'GoodNewsEveryone',
@@ -59,9 +43,7 @@ describe('Official plugin auth-ldap', function () {
59 }) 43 })
60 44
61 it('Should not login with good LDAP settings but wrong username/password', async function () { 45 it('Should not login with good LDAP settings but wrong username/password', async function () {
62 await updatePluginSettings({ 46 await server.pluginsCommand.updateSettings({
63 url: server.url,
64 accessToken: server.accessToken,
65 npmName: 'peertube-plugin-auth-ldap', 47 npmName: 'peertube-plugin-auth-ldap',
66 settings: { 48 settings: {
67 'bind-credentials': 'GoodNewsEveryone', 49 'bind-credentials': 'GoodNewsEveryone',
@@ -114,7 +96,7 @@ describe('Official plugin auth-ldap', function () {
114 }) 96 })
115 97
116 it('Should not login if the plugin is uninstalled', async function () { 98 it('Should not login if the plugin is uninstalled', async function () {
117 await uninstallPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-auth-ldap' }) 99 await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-auth-ldap' })
118 100
119 await userLogin(server, { username: 'fry@planetexpress.com', password: 'fry' }, 400) 101 await userLogin(server, { username: 'fry@planetexpress.com', password: 'fry' }, 400)
120 }) 102 })