aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/filter-hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/plugins/filter-hooks.ts')
-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')