1 /* tslint:disable:no-unused-expression */
4 import * as chai from 'chai'
5 import { About } from '../../../../shared/models/server/about.model'
6 import { CustomConfig } from '../../../../shared/models/server/custom-config.model'
13 getCustomConfig, installPlugin,
14 killallServers, parallelTests,
16 reRunServer, ServerInfo,
17 setAccessTokensToServers,
18 updateCustomConfig, uploadVideo
19 } from '../../../../shared/extra-utils'
20 import { ServerConfig } from '../../../../shared/models'
21 import { PeerTubePlugin } from '../../../../shared/models/plugins/peertube-plugin.model'
23 const expect = chai.expect
25 describe('Test plugins', function () {
28 before(async function () {
31 server = await flushAndRunServer(1)
32 await setAccessTokensToServers([ server ])
35 await installPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-hello-world' })
39 await installPlugin({ url: server.url, accessToken: server.accessToken, npmName: 'peertube-plugin-background-color' })
43 it('Should list available plugins and themes', async function () {
44 // List without filter
45 // List with filter (plugin and theme)
48 it('Should search available plugins', async function () {
49 // Search with filter (plugin and theme)
52 // Add peertube engine
55 it('Should have an empty global css', async function () {
59 it('Should install a plugin and a theme', async function () {
63 it('Should have the correct global css', async function () {
67 it('Should have the plugin loaded in the configuration', async function () {
68 // Check registered themes/plugins
71 it('Should update the default theme in the configuration', async function () {
75 it('Should list plugins and themes', async function () {
76 // List without filter
77 // List with filter (theme/plugin)
78 // List with pagination
82 it('Should get a plugin and a theme', async function () {
87 it('Should get registered settings', async function () {
91 it('Should update the settings', async function () {
97 it('Should update the plugin and the theme', async function () {
98 // update BDD -> 0.0.1
99 // update package.json (theme + plugin)
100 // list to check versions
101 // update plugin + theme
102 // list to check they have been updated
103 // check package.json are upgraded too
106 it('Should uninstall the plugin', async function () {
111 it('Should have an empty global css', async function () {
115 it('Should list uninstalled plugins', async function () {
116 // { uninstalled: true }
119 it('Should uninstall the theme', async function () {
123 it('Should have updated the configuration', async function () {
124 // get /config (default theme + registered themes + registered plugins)
127 after(async function () {
128 await cleanupTests([ server ])