aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2022-10-10 15:18:31 +0200
committerGitHub <noreply@github.com>2022-10-10 15:18:31 +0200
commitc43ed8e8624383db5a0cf22b210cee202bae323c (patch)
treed2d2c3d06a0b15048bf1e1893b2bc8d07ed2214d /server/tests/plugins
parent213bb3bb58b719679d533811b2e2c3852a3dd067 (diff)
downloadPeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.tar.gz
PeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.tar.zst
PeerTube-c43ed8e8624383db5a0cf22b210cee202bae323c.zip
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
Diffstat (limited to 'server/tests/plugins')
-rw-r--r--server/tests/plugins/plugin-helpers.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.ts
index 955d7ddfd..31c18350a 100644
--- a/server/tests/plugins/plugin-helpers.ts
+++ b/server/tests/plugins/plugin-helpers.ts
@@ -83,6 +83,33 @@ describe('Test plugin helpers', function () {
83 }) 83 })
84 }) 84 })
85 85
86 describe('Socket', function () {
87
88 it('Should sendNotification without any exceptions', async () => {
89 const user = await servers[0].users.create({ username: 'notis_redding', password: 'secret1234?' })
90 await makePostBodyRequest({
91 url: servers[0].url,
92 path: '/plugins/test-four/router/send-notification',
93 fields: {
94 userId: user.id
95 },
96 expectedStatus: HttpStatusCode.CREATED_201
97 })
98 })
99
100 it('Should sendVideoLiveNewState without any exceptions', async () => {
101 const res = await servers[0].videos.quickUpload({ name: 'video server 1' })
102
103 await makePostBodyRequest({
104 url: servers[0].url,
105 path: '/plugins/test-four/router/send-video-live-new-state/' + res.uuid,
106 expectedStatus: HttpStatusCode.CREATED_201
107 })
108
109 await servers[0].videos.remove({ id: res.uuid })
110 })
111 })
112
86 describe('Plugin', function () { 113 describe('Plugin', function () {
87 114
88 it('Should get the base static route', async function () { 115 it('Should get the base static route', async function () {