aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/external-plugins/auth-ldap.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tests/external-plugins/auth-ldap.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tests/external-plugins/auth-ldap.ts')
-rw-r--r--server/tests/external-plugins/auth-ldap.ts34
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/external-plugins/auth-ldap.ts b/server/tests/external-plugins/auth-ldap.ts
index b626ab2bb..ef624152e 100644
--- a/server/tests/external-plugins/auth-ldap.ts
+++ b/server/tests/external-plugins/auth-ldap.ts
@@ -16,15 +16,15 @@ describe('Official plugin auth-ldap', function () {
16 server = await flushAndRunServer(1) 16 server = await flushAndRunServer(1)
17 await setAccessTokensToServers([ server ]) 17 await setAccessTokensToServers([ server ])
18 18
19 await server.pluginsCommand.install({ npmName: 'peertube-plugin-auth-ldap' }) 19 await server.plugins.install({ npmName: 'peertube-plugin-auth-ldap' })
20 }) 20 })
21 21
22 it('Should not login with without LDAP settings', async function () { 22 it('Should not login with without LDAP settings', async function () {
23 await server.loginCommand.login({ user: { username: 'fry', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 23 await server.login.login({ user: { username: 'fry', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
24 }) 24 })
25 25
26 it('Should not login with bad LDAP settings', async function () { 26 it('Should not login with bad LDAP settings', async function () {
27 await server.pluginsCommand.updateSettings({ 27 await server.plugins.updateSettings({
28 npmName: 'peertube-plugin-auth-ldap', 28 npmName: 'peertube-plugin-auth-ldap',
29 settings: { 29 settings: {
30 'bind-credentials': 'GoodNewsEveryone', 30 'bind-credentials': 'GoodNewsEveryone',
@@ -38,11 +38,11 @@ describe('Official plugin auth-ldap', function () {
38 } 38 }
39 }) 39 })
40 40
41 await server.loginCommand.login({ user: { username: 'fry', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 41 await server.login.login({ user: { username: 'fry', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
42 }) 42 })
43 43
44 it('Should not login with good LDAP settings but wrong username/password', async function () { 44 it('Should not login with good LDAP settings but wrong username/password', async function () {
45 await server.pluginsCommand.updateSettings({ 45 await server.plugins.updateSettings({
46 npmName: 'peertube-plugin-auth-ldap', 46 npmName: 'peertube-plugin-auth-ldap',
47 settings: { 47 settings: {
48 'bind-credentials': 'GoodNewsEveryone', 48 'bind-credentials': 'GoodNewsEveryone',
@@ -56,20 +56,20 @@ describe('Official plugin auth-ldap', function () {
56 } 56 }
57 }) 57 })
58 58
59 await server.loginCommand.login({ user: { username: 'fry', password: 'bad password' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 59 await server.login.login({ user: { username: 'fry', password: 'bad password' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
60 await server.loginCommand.login({ user: { username: 'fryr', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) 60 await server.login.login({ user: { username: 'fryr', password: 'fry' }, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
61 }) 61 })
62 62
63 it('Should login with the appropriate username/password', async function () { 63 it('Should login with the appropriate username/password', async function () {
64 accessToken = await server.loginCommand.getAccessToken({ username: 'fry', password: 'fry' }) 64 accessToken = await server.login.getAccessToken({ username: 'fry', password: 'fry' })
65 }) 65 })
66 66
67 it('Should login with the appropriate email/password', async function () { 67 it('Should login with the appropriate email/password', async function () {
68 accessToken = await server.loginCommand.getAccessToken({ username: 'fry@planetexpress.com', password: 'fry' }) 68 accessToken = await server.login.getAccessToken({ username: 'fry@planetexpress.com', password: 'fry' })
69 }) 69 })
70 70
71 it('Should login get my profile', async function () { 71 it('Should login get my profile', async function () {
72 const body = await server.usersCommand.getMyInfo({ token: accessToken }) 72 const body = await server.users.getMyInfo({ token: accessToken })
73 expect(body.username).to.equal('fry') 73 expect(body.username).to.equal('fry')
74 expect(body.email).to.equal('fry@planetexpress.com') 74 expect(body.email).to.equal('fry@planetexpress.com')
75 75
@@ -77,28 +77,28 @@ describe('Official plugin auth-ldap', function () {
77 }) 77 })
78 78
79 it('Should upload a video', async function () { 79 it('Should upload a video', async function () {
80 await server.videosCommand.upload({ token: accessToken, attributes: { name: 'my super video' } }) 80 await server.videos.upload({ token: accessToken, attributes: { name: 'my super video' } })
81 }) 81 })
82 82
83 it('Should not be able to login if the user is banned', async function () { 83 it('Should not be able to login if the user is banned', async function () {
84 await server.usersCommand.banUser({ userId }) 84 await server.users.banUser({ userId })
85 85
86 await server.loginCommand.login({ 86 await server.login.login({
87 user: { username: 'fry@planetexpress.com', password: 'fry' }, 87 user: { username: 'fry@planetexpress.com', password: 'fry' },
88 expectedStatus: HttpStatusCode.BAD_REQUEST_400 88 expectedStatus: HttpStatusCode.BAD_REQUEST_400
89 }) 89 })
90 }) 90 })
91 91
92 it('Should be able to login if the user is unbanned', async function () { 92 it('Should be able to login if the user is unbanned', async function () {
93 await server.usersCommand.unbanUser({ userId }) 93 await server.users.unbanUser({ userId })
94 94
95 await server.loginCommand.login({ user: { username: 'fry@planetexpress.com', password: 'fry' } }) 95 await server.login.login({ user: { username: 'fry@planetexpress.com', password: 'fry' } })
96 }) 96 })
97 97
98 it('Should not login if the plugin is uninstalled', async function () { 98 it('Should not login if the plugin is uninstalled', async function () {
99 await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-auth-ldap' }) 99 await server.plugins.uninstall({ npmName: 'peertube-plugin-auth-ldap' })
100 100
101 await server.loginCommand.login({ 101 await server.login.login({
102 user: { username: 'fry@planetexpress.com', password: 'fry' }, 102 user: { username: 'fry@planetexpress.com', password: 'fry' },
103 expectedStatus: HttpStatusCode.BAD_REQUEST_400 103 expectedStatus: HttpStatusCode.BAD_REQUEST_400
104 }) 104 })