From 353f8bc0c7a71ad490e4501b8c80e13e5cec1932 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Nov 2020 11:41:38 +0100 Subject: Add registered setting CLI plugin install test --- server/tests/api/server/plugins.ts | 16 ++-------------- server/tests/cli/peertube.ts | 5 +++++ 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'server/tests') diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts index ecf7c0d3f..1c6eabe6d 100644 --- a/server/tests/api/server/plugins.ts +++ b/server/tests/api/server/plugins.ts @@ -10,7 +10,6 @@ import { getMyUserInformation, getPlugin, getPluginPackageJSON, - getPluginRegisteredSettings, getPublicSettings, installPlugin, killallServers, @@ -20,6 +19,7 @@ import { ServerInfo, setAccessTokensToServers, setPluginVersion, + testHelloWorldRegisteredSettings, uninstallPlugin, updateCustomSubConfig, updateMyUser, @@ -34,7 +34,6 @@ import { PeerTubePlugin } from '../../../../shared/models/plugins/peertube-plugi import { PluginPackageJson } from '../../../../shared/models/plugins/plugin-package-json.model' import { PluginType } from '../../../../shared/models/plugins/plugin.type' import { PublicServerSetting } from '../../../../shared/models/plugins/public-server.setting' -import { RegisteredServerSettings } from '../../../../shared/models/plugins/register-server-setting.model' import { ServerConfig } from '../../../../shared/models/server' import { User } from '../../../../shared/models/users' @@ -209,18 +208,7 @@ describe('Test plugins', function () { }) it('Should get registered settings', async function () { - const res = await getPluginRegisteredSettings({ - url: server.url, - accessToken: server.accessToken, - npmName: 'peertube-plugin-hello-world' - }) - - const registeredSettings = (res.body as RegisteredServerSettings).registeredSettings - - expect(registeredSettings).to.have.length.at.least(1) - - const adminNameSettings = registeredSettings.find(s => s.name === 'admin-name') - expect(adminNameSettings).to.not.be.undefined + await testHelloWorldRegisteredSettings(server) }) it('Should get public settings', async function () { diff --git a/server/tests/cli/peertube.ts b/server/tests/cli/peertube.ts index e2861f46e..348438533 100644 --- a/server/tests/cli/peertube.ts +++ b/server/tests/cli/peertube.ts @@ -19,6 +19,7 @@ import { removeVideo, ServerInfo, setAccessTokensToServers, + testHelloWorldRegisteredSettings, uploadVideoAndGetId, userLogin, waitJobs @@ -205,6 +206,10 @@ describe('Test CLI wrapper', function () { await execCLI(`${env} ${cmd} plugins install --npm-name peertube-plugin-hello-world`) }) + it('Should have registered settings', async function () { + await testHelloWorldRegisteredSettings(server) + }) + it('Should list installed plugins', async function () { const env = getEnvCli(server) const res = await execCLI(`${env} ${cmd} plugins list`) -- cgit v1.2.3