diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-07 10:33:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | ae2abfd3aed3e75d39a316b49b914d187faa7475 (patch) | |
tree | 4d5060dc310f3d8cdcd5829779522f49b3d10e71 /server/tests/plugins/id-and-pass-auth.ts | |
parent | 9c6327f803aaf4200672f1fc40b2f43786daca47 (diff) | |
download | PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.gz PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.tar.zst PeerTube-ae2abfd3aed3e75d39a316b49b914d187faa7475.zip |
Introduce plugins command
Diffstat (limited to 'server/tests/plugins/id-and-pass-auth.ts')
-rw-r--r-- | server/tests/plugins/id-and-pass-auth.ts | 36 |
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 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { cleanupTests, flushAndRunServer, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers' | 4 | import { expect } from 'chai' |
5 | import { | 5 | import { |
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' |
17 | import { User, UserRole, ServerConfig } from '@shared/models' | 22 | import { ServerConfig, User, UserRole } from '@shared/models' |
18 | import { expect } from 'chai' | ||
19 | 23 | ||
20 | describe('Test id and pass auth plugins', function () { | 24 | describe('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 | }) |