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'
+import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
function postCommand (server: ServerInfo, command: string, bodyArg?: object) {
const body = { command }
url: server.url,
path: '/plugins/test-four/router/commander',
fields: body,
- statusCodeExpected: 204
+ statusCodeExpected: HttpStatusCode.NO_CONTENT_204
})
}
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 () {
})
})
+ 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
before(async function () {
- this.timeout(15000)
+ this.timeout(30000)
{
const res = await uploadVideoAndGetId({ server: servers[0], videoName: 'video server 1' })
})
it('Should remove a video after a view', async function () {
- this.timeout(20000)
+ this.timeout(40000)
// Should not throw -> video exists
await getVideo(servers[0].url, videoUUID)