aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-30 09:28:39 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commita5896799f169d3313b63165fe6a79d4149fa6df1 (patch)
tree0151902e829dce13bbb22ff0fe6967ce6bee4058 /server/tests
parentdadc90bca257f2d785713a37949c3a1bf6a5243d (diff)
downloadPeerTube-a5896799f169d3313b63165fe6a79d4149fa6df1.tar.gz
PeerTube-a5896799f169d3313b63165fe6a79d4149fa6df1.tar.zst
PeerTube-a5896799f169d3313b63165fe6a79d4149fa6df1.zip
Add plugin settings change watcher
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/server/plugins.ts11
-rw-r--r--server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js4
-rw-r--r--server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js2
3 files changed, 12 insertions, 5 deletions
diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts
index 452d05012..9885be4e8 100644
--- a/server/tests/api/server/plugins.ts
+++ b/server/tests/api/server/plugins.ts
@@ -27,7 +27,8 @@ import {
27 updatePlugin, 27 updatePlugin,
28 updatePluginPackageJSON, 28 updatePluginPackageJSON,
29 updatePluginSettings, 29 updatePluginSettings,
30 wait 30 wait,
31 waitUntilLog
31} from '../../../../shared/extra-utils' 32} from '../../../../shared/extra-utils'
32import { PluginType } from '../../../../shared/models/plugins/plugin.type' 33import { PluginType } from '../../../../shared/models/plugins/plugin.type'
33import { PeerTubePluginIndex } from '../../../../shared/models/plugins/peertube-plugin-index.model' 34import { PeerTubePluginIndex } from '../../../../shared/models/plugins/peertube-plugin-index.model'
@@ -142,7 +143,7 @@ describe('Test plugins', function () {
142 it('Should have the correct global css', async function () { 143 it('Should have the correct global css', async function () {
143 const res = await getPluginsCSS(server.url) 144 const res = await getPluginsCSS(server.url)
144 145
145 expect(res.text).to.contain('--mainBackgroundColor') 146 expect(res.text).to.contain('background-color: red')
146 }) 147 })
147 148
148 it('Should have the plugin loaded in the configuration', async function () { 149 it('Should have the plugin loaded in the configuration', async function () {
@@ -258,6 +259,12 @@ describe('Test plugins', function () {
258 }) 259 })
259 }) 260 })
260 261
262 it('Should have watched settings changes', async function () {
263 this.timeout(10000)
264
265 await waitUntilLog(server, 'Settings changed!')
266 })
267
261 it('Should get a plugin and a theme', async function () { 268 it('Should get a plugin and a theme', async function () {
262 { 269 {
263 const res = await getPlugin({ 270 const res = await getPlugin({
diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js b/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
index f29fd1f30..91c67e550 100644
--- a/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-external-auth-one/main.js
@@ -5,7 +5,7 @@ async function register ({
5 { 5 {
6 const result = registerExternalAuth({ 6 const result = registerExternalAuth({
7 authName: 'external-auth-1', 7 authName: 'external-auth-1',
8 authDisplayName: 'External Auth 1', 8 authDisplayName: () => 'External Auth 1',
9 onLogout: user => peertubeHelpers.logger.info('On logout %s', user.username), 9 onLogout: user => peertubeHelpers.logger.info('On logout %s', user.username),
10 onAuthRequest: (req, res) => { 10 onAuthRequest: (req, res) => {
11 const username = req.query.username 11 const username = req.query.username
@@ -23,7 +23,7 @@ async function register ({
23 { 23 {
24 const result = registerExternalAuth({ 24 const result = registerExternalAuth({
25 authName: 'external-auth-2', 25 authName: 'external-auth-2',
26 authDisplayName: 'External Auth 2', 26 authDisplayName: () => 'External Auth 2',
27 onAuthRequest: (req, res) => { 27 onAuthRequest: (req, res) => {
28 result.userAuthenticated({ 28 result.userAuthenticated({
29 req, 29 req,
diff --git a/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js
index 34fec1bb3..126905ffc 100644
--- a/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-external-auth-two/main.js
@@ -5,7 +5,7 @@ async function register ({
5 { 5 {
6 const result = registerExternalAuth({ 6 const result = registerExternalAuth({
7 authName: 'external-auth-3', 7 authName: 'external-auth-3',
8 authDisplayName: 'External Auth 3', 8 authDisplayName: () => 'External Auth 3',
9 onAuthRequest: (req, res) => { 9 onAuthRequest: (req, res) => {
10 result.userAuthenticated({ 10 result.userAuthenticated({
11 req, 11 req,