X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Fplugins.ts;h=6046ab97e21edc858adfcc1d7c35447c4d272ca9;hb=5ec3cbdf22fc88ebe57f370fc0bc0e3df7453458;hp=452d050125e153a3c87d14e0d0b829691c4dc10e;hpb=818c449b3c34e9f324ac744120c8774e724ab25e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts index 452d05012..6046ab97e 100644 --- a/server/tests/api/server/plugins.ts +++ b/server/tests/api/server/plugins.ts @@ -10,8 +10,6 @@ import { getMyUserInformation, getPlugin, getPluginPackageJSON, - getPluginRegisteredSettings, - getPluginsCSS, getPublicSettings, installPlugin, killallServers, @@ -21,22 +19,17 @@ import { ServerInfo, setAccessTokensToServers, setPluginVersion, + testHelloWorldRegisteredSettings, uninstallPlugin, updateCustomSubConfig, updateMyUser, updatePlugin, updatePluginPackageJSON, updatePluginSettings, - wait -} from '../../../../shared/extra-utils' -import { PluginType } from '../../../../shared/models/plugins/plugin.type' -import { PeerTubePluginIndex } from '../../../../shared/models/plugins/peertube-plugin-index.model' -import { ServerConfig } from '../../../../shared/models/server' -import { PeerTubePlugin } from '../../../../shared/models/plugins/peertube-plugin.model' -import { User } from '../../../../shared/models/users' -import { PluginPackageJson } from '../../../../shared/models/plugins/plugin-package-json.model' -import { RegisteredServerSettings } from '../../../../shared/models/plugins/register-server-setting.model' -import { PublicServerSetting } from '../../../../shared/models/plugins/public-server.setting' + wait, + waitUntilLog +} from '@shared/extra-utils' +import { PeerTubePlugin, PeerTubePluginIndex, PluginPackageJson, PluginType, PublicServerSetting, ServerConfig, User } from '@shared/models' const expect = chai.expect @@ -117,12 +110,6 @@ describe('Test plugins', function () { } }) - it('Should have an empty global css', async function () { - const res = await getPluginsCSS(server.url) - - expect(res.text).to.be.empty - }) - it('Should install a plugin and a theme', async function () { this.timeout(30000) @@ -139,12 +126,6 @@ describe('Test plugins', function () { }) }) - it('Should have the correct global css', async function () { - const res = await getPluginsCSS(server.url) - - expect(res.text).to.contain('--mainBackgroundColor') - }) - it('Should have the plugin loaded in the configuration', async function () { const res = await getConfig(server.url) const config: ServerConfig = res.body @@ -221,18 +202,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 () { @@ -258,6 +228,12 @@ describe('Test plugins', function () { }) }) + it('Should have watched settings changes', async function () { + this.timeout(10000) + + await waitUntilLog(server, 'Settings changed!') + }) + it('Should get a plugin and a theme', async function () { { const res = await getPlugin({ @@ -308,7 +284,7 @@ describe('Test plugins', function () { }) it('Should update the plugin and the theme', async function () { - this.timeout(30000) + this.timeout(90000) // Wait the scheduler that get the latest plugins versions await wait(6000) @@ -380,12 +356,6 @@ describe('Test plugins', function () { expect(res.body.data).to.have.lengthOf(0) }) - it('Should have an empty global css', async function () { - const res = await getPluginsCSS(server.url) - - expect(res.text).to.be.empty - }) - it('Should list uninstalled plugins', async function () { const res = await listPlugins({ url: server.url,