1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add registered setting CLI plugin install test

This commit is contained in:
Chocobozzz 2020-11-27 11:41:38 +01:00
parent e2c1f77957
commit 353f8bc0c7
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 27 additions and 14 deletions

View file

@ -1,5 +1,9 @@
/* 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'
@ -119,6 +123,21 @@ function getPluginRegisteredSettings (parameters: {
})
}
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
@ -265,6 +284,7 @@ export {
updatePlugin,
getPlugin,
uninstallPlugin,
testHelloWorldRegisteredSettings,
updatePluginSettings,
getPluginRegisteredSettings,
getPackageJSONPath,