1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Expose PeerTube socket to plugins (#5239)

* server(pluginHelpers): add socket

* test(plugins): add socket cases

* fixes after review

* Update plugin-helpers.ts

* Update plugin-helpers.ts
This commit is contained in:
kontrollanten 2022-10-10 15:18:31 +02:00 committed by GitHub
parent 213bb3bb58
commit c43ed8e862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 2 deletions

View file

@ -83,6 +83,33 @@ describe('Test plugin helpers', function () {
})
})
describe('Socket', function () {
it('Should sendNotification without any exceptions', async () => {
const user = await servers[0].users.create({ username: 'notis_redding', password: 'secret1234?' })
await makePostBodyRequest({
url: servers[0].url,
path: '/plugins/test-four/router/send-notification',
fields: {
userId: user.id
},
expectedStatus: HttpStatusCode.CREATED_201
})
})
it('Should sendVideoLiveNewState without any exceptions', async () => {
const res = await servers[0].videos.quickUpload({ name: 'video server 1' })
await makePostBodyRequest({
url: servers[0].url,
path: '/plugins/test-four/router/send-video-live-new-state/' + res.uuid,
expectedStatus: HttpStatusCode.CREATED_201
})
await servers[0].videos.remove({ id: res.uuid })
})
})
describe('Plugin', function () {
it('Should get the base static route', async function () {