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

Add data directory for plugins and some helpers

This commit is contained in:
Chocobozzz 2021-04-22 10:55:28 +02:00
parent 3e0e8d4afd
commit 302eba0d89
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 245 additions and 24 deletions

View file

@ -100,6 +100,46 @@ describe('Test plugin helpers', function () {
expect(res.body.staticRoute).to.equal('/plugins/test-four/0.0.1/static/')
})
it('Should get the base static route', async function () {
const baseRouter = '/plugins/test-four/0.0.1/router/'
const res = await makeGetRequest({
url: servers[0].url,
path: baseRouter + 'router-route',
statusCodeExpected: HttpStatusCode.OK_200
})
expect(res.body.routerRoute).to.equal(baseRouter)
})
})
describe('User', function () {
it('Should not get a user if not authenticated', async function () {
const res = await makeGetRequest({
url: servers[0].url,
path: '/plugins/test-four/router/user',
statusCodeExpected: HttpStatusCode.OK_200
})
expect(res.body.user).to.be.undefined
})
it('Should get a user if authenticated', async function () {
const res = await makeGetRequest({
url: servers[0].url,
token: servers[0].accessToken,
path: '/plugins/test-four/router/user',
statusCodeExpected: HttpStatusCode.OK_200
})
expect(res.body.user).to.exist
expect(res.body.username).to.equal('root')
expect(res.body.isAdmin).to.be.true
expect(res.body.isModerator).to.be.false
expect(res.body.isUser).to.be.false
})
})
describe('Moderation', function () {