aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins
diff options
context:
space:
mode:
authorWicklow <wicklow@framasoft.org>2023-02-24 16:21:26 +0100
committerChocobozzz <chocobozzz@cpy.re>2023-02-25 15:47:48 +0100
commitc0687c91b9cf185c36e477ab30266c779f792ee1 (patch)
tree5c917b6b87b38eb89620ed21b114ac67c96a71d9 /server/tests/plugins
parentd41f4a6dc69d098e9dc9173b7e1a586695ef7b97 (diff)
downloadPeerTube-c0687c91b9cf185c36e477ab30266c779f792ee1.tar.gz
PeerTube-c0687c91b9cf185c36e477ab30266c779f792ee1.tar.zst
PeerTube-c0687c91b9cf185c36e477ab30266c779f792ee1.zip
Add server hooks for listing subscription
Diffstat (limited to 'server/tests/plugins')
-rw-r--r--server/tests/plugins/filter-hooks.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts
index 37eef6cf3..6bd38cf65 100644
--- a/server/tests/plugins/filter-hooks.ts
+++ b/server/tests/plugins/filter-hooks.ts
@@ -71,6 +71,9 @@ describe('Test plugin filter hooks', function () {
71 } 71 }
72 } 72 }
73 }) 73 })
74
75 // Root subscribes to itself
76 await servers[0].subscriptions.add({ targetUri: 'root_channel@' + servers[0].host })
74 }) 77 })
75 78
76 describe('Videos', function () { 79 describe('Videos', function () {
@@ -151,6 +154,20 @@ describe('Test plugin filter hooks', function () {
151 expect(total).to.equal(14) 154 expect(total).to.equal(14)
152 }) 155 })
153 156
157 it('Should run filter:api.user.me.subscription-videos.list.params', async function () {
158 const { data } = await servers[0].subscriptions.listVideos()
159
160 // 1 plugin set the count parameter to 1
161 expect(data).to.have.lengthOf(1)
162 })
163
164 it('Should run filter:api.user.me.subscription-videos.list.result', async function () {
165 const { total } = await servers[0].subscriptions.listVideos()
166
167 // Plugin do +4 to the total result
168 expect(total).to.equal(14)
169 })
170
154 it('Should run filter:api.video.get.result', async function () { 171 it('Should run filter:api.video.get.result', async function () {
155 const video = await servers[0].videos.get({ id: videoUUID }) 172 const video = await servers[0].videos.get({ id: videoUUID })
156 expect(video.name).to.contain('<3') 173 expect(video.name).to.contain('<3')