1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add server plugin helpers

This commit is contained in:
Chocobozzz 2021-04-09 14:51:28 +02:00
parent 023edc8a54
commit 22820226e5
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 326 additions and 249 deletions

View file

@ -12,7 +12,8 @@ import {
uploadVideoAndGetId,
viewVideo,
getVideosList,
waitJobs
waitJobs,
makeGetRequest
} from '../../../shared/extra-utils'
import { cleanupTests, flushAndRunMultipleServers, ServerInfo, waitUntilLog } from '../../../shared/extra-utils/server/servers'
import { expect } from 'chai'
@ -68,6 +69,17 @@ describe('Test plugin helpers', function () {
it('Should have the correct webserver url', async function () {
await waitUntilLog(servers[0], `server url is http://localhost:${servers[0].port}`)
})
it('Should have the correct config', async function () {
const res = await makeGetRequest({
url: servers[0].url,
path: '/plugins/test-four/router/server-config',
statusCodeExpected: HttpStatusCode.OK_200
})
expect(res.body.serverConfig).to.exist
expect(res.body.serverConfig.instance.name).to.equal('PeerTube')
})
})
describe('Server', function () {
@ -77,6 +89,19 @@ describe('Test plugin helpers', function () {
})
})
describe('Plugin', function () {
it('Should get the base static route', async function () {
const res = await makeGetRequest({
url: servers[0].url,
path: '/plugins/test-four/router/static-route',
statusCodeExpected: HttpStatusCode.OK_200
})
expect(res.body.staticRoute).to.equal('/plugins/test-four/0.0.1/static/')
})
})
describe('Moderation', function () {
let videoUUIDServer1: string