getMyUserInformation,
getPlugin,
getPluginPackageJSON,
- getPluginRegisteredSettings,
getPublicSettings,
installPlugin,
killallServers,
ServerInfo,
setAccessTokensToServers,
setPluginVersion,
+ testHelloWorldRegisteredSettings,
uninstallPlugin,
updateCustomSubConfig,
updateMyUser,
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'
})
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 () {
removeVideo,
ServerInfo,
setAccessTokensToServers,
+ testHelloWorldRegisteredSettings,
uploadVideoAndGetId,
userLogin,
waitJobs
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`)
+/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
+
+import { expect } from 'chai'
import { readJSON, writeJSON } from 'fs-extra'
import { join } from 'path'
+import { RegisteredServerSettings } from '@shared/models'
import { PeertubePluginIndexList } from '../../models/plugins/peertube-plugin-index-list.model'
import { PluginType } from '../../models/plugins/plugin.type'
import { buildServerDirectory, root } from '../miscs/miscs'
})
}
+async function testHelloWorldRegisteredSettings (server: ServerInfo) {
+ 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
+}
+
function getPublicSettings (parameters: {
url: string
npmName: string
updatePlugin,
getPlugin,
uninstallPlugin,
+ testHelloWorldRegisteredSettings,
updatePluginSettings,
getPluginRegisteredSettings,
getPackageJSONPath,