+ await updatePluginSettings({
+ url: server.url,
+ accessToken: server.accessToken,
+ npmName: 'peertube-plugin-hello-world',
+ settings
+ })
+ })
+
+ 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({
+ url: server.url,
+ accessToken: server.accessToken,
+ npmName: 'peertube-plugin-hello-world'
+ })
+
+ const plugin: PeerTubePlugin = res.body
+
+ expect(plugin.type).to.equal(PluginType.PLUGIN)
+ expect(plugin.name).to.equal('hello-world')
+ expect(plugin.description).to.exist
+ expect(plugin.homepage).to.exist
+ expect(plugin.uninstalled).to.be.false
+ expect(plugin.enabled).to.be.true
+ expect(plugin.description).to.exist
+ expect(plugin.version).to.exist
+ expect(plugin.peertubeEngine).to.exist
+ expect(plugin.createdAt).to.exist
+
+ expect(plugin.settings).to.not.be.undefined
+ expect(plugin.settings['admin-name']).to.equal('Cid')
+ }
+
+ {
+ const res = await getPlugin({
+ url: server.url,
+ accessToken: server.accessToken,
+ npmName: 'peertube-theme-background-red'
+ })
+
+ const plugin: PeerTubePlugin = res.body
+
+ expect(plugin.type).to.equal(PluginType.THEME)
+ expect(plugin.name).to.equal('background-red')
+ expect(plugin.description).to.exist
+ expect(plugin.homepage).to.exist
+ expect(plugin.uninstalled).to.be.false
+ expect(plugin.enabled).to.be.true
+ expect(plugin.description).to.exist
+ expect(plugin.version).to.exist
+ expect(plugin.peertubeEngine).to.exist
+ expect(plugin.createdAt).to.exist
+
+ expect(plugin.settings).to.be.null
+ }