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.ts36
1 files changed, 15 insertions, 21 deletions
diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts
index cbba638c2..545968040 100644
--- a/server/tests/plugins/id-and-pass-auth.ts
+++ b/server/tests/plugins/id-and-pass-auth.ts
@@ -1,21 +1,25 @@
1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import 'mocha' 3import 'mocha'
4import { cleanupTests, flushAndRunServer, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers' 4import { expect } from 'chai'
5import { 5import {
6 cleanupTests,
7 flushAndRunServer,
8 getConfig,
6 getMyUserInformation, 9 getMyUserInformation,
7 getPluginTestPath, 10 getUsersList,
8 installPlugin, 11 login,
9 logout, 12 logout,
13 PluginsCommand,
14 refreshToken,
15 ServerInfo,
10 setAccessTokensToServers, 16 setAccessTokensToServers,
11 uninstallPlugin,
12 updateMyUser, 17 updateMyUser,
13 userLogin, 18 userLogin,
14 wait, 19 wait,
15 login, refreshToken, getConfig, updatePluginSettings, getUsersList 20 waitUntilLog
16} from '../../../shared/extra-utils' 21} from '@shared/extra-utils'
17import { User, UserRole, ServerConfig } from '@shared/models' 22import { ServerConfig, User, UserRole } from '@shared/models'
18import { expect } from 'chai'
19 23
20describe('Test id and pass auth plugins', function () { 24describe('Test id and pass auth plugins', function () {
21 let server: ServerInfo 25 let server: ServerInfo
@@ -33,11 +37,7 @@ describe('Test id and pass auth plugins', function () {
33 await setAccessTokensToServers([ server ]) 37 await setAccessTokensToServers([ server ])
34 38
35 for (const suffix of [ 'one', 'two', 'three' ]) { 39 for (const suffix of [ 'one', 'two', 'three' ]) {
36 await installPlugin({ 40 await server.pluginsCommand.install({ path: PluginsCommand.getPluginTestPath('-id-pass-auth-' + suffix) })
37 url: server.url,
38 accessToken: server.accessToken,
39 path: getPluginTestPath('-id-pass-auth-' + suffix)
40 })
41 } 41 }
42 }) 42 })
43 43
@@ -180,9 +180,7 @@ describe('Test id and pass auth plugins', function () {
180 }) 180 })
181 181
182 it('Should unregister spyro-auth and do not login existing Spyro', async function () { 182 it('Should unregister spyro-auth and do not login existing Spyro', async function () {
183 await updatePluginSettings({ 183 await server.pluginsCommand.updateSettings({
184 url: server.url,
185 accessToken: server.accessToken,
186 npmName: 'peertube-plugin-test-id-pass-auth-one', 184 npmName: 'peertube-plugin-test-id-pass-auth-one',
187 settings: { disableSpyro: true } 185 settings: { disableSpyro: true }
188 }) 186 })
@@ -204,11 +202,7 @@ describe('Test id and pass auth plugins', function () {
204 }) 202 })
205 203
206 it('Should uninstall the plugin one and do not login existing Crash', async function () { 204 it('Should uninstall the plugin one and do not login existing Crash', async function () {
207 await uninstallPlugin({ 205 await server.pluginsCommand.uninstall({ npmName: 'peertube-plugin-test-id-pass-auth-one' })
208 url: server.url,
209 accessToken: server.accessToken,
210 npmName: 'peertube-plugin-test-id-pass-auth-one'
211 })
212 206
213 await userLogin(server, { username: 'crash', password: 'crash password' }, 400) 207 await userLogin(server, { username: 'crash', password: 'crash password' }, 400)
214 }) 208 })