aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-08 10:30:33 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-08 10:33:23 +0100
commit38267c0c8aa80f974a2c0b4c2bd33c8d8008ac94 (patch)
treedd99242abdd5a02de272be0f06ecfe03edadc575 /server/tests/plugins
parent1bfc07e4cca1464c87c317060eb86742344467a6 (diff)
downloadPeerTube-38267c0c8aa80f974a2c0b4c2bd33c8d8008ac94.tar.gz
PeerTube-38267c0c8aa80f974a2c0b4c2bd33c8d8008ac94.tar.zst
PeerTube-38267c0c8aa80f974a2c0b4c2bd33c8d8008ac94.zip
Use dedicated hooks for account/channel videos
Diffstat (limited to 'server/tests/plugins')
-rw-r--r--server/tests/plugins/filter-hooks.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts
index 9939b8e6e..3a5c7aa62 100644
--- a/server/tests/plugins/filter-hooks.ts
+++ b/server/tests/plugins/filter-hooks.ts
@@ -8,9 +8,11 @@ import {
8 addVideoCommentThread, 8 addVideoCommentThread,
9 createLive, 9 createLive,
10 doubleFollow, 10 doubleFollow,
11 getAccountVideos,
11 getConfig, 12 getConfig,
12 getPluginTestPath, 13 getPluginTestPath,
13 getVideo, 14 getVideo,
15 getVideoChannelVideos,
14 getVideoCommentThreads, 16 getVideoCommentThreads,
15 getVideosList, 17 getVideosList,
16 getVideosListPagination, 18 getVideosListPagination,
@@ -90,6 +92,34 @@ describe('Test plugin filter hooks', function () {
90 expect(res.body.total).to.equal(11) 92 expect(res.body.total).to.equal(11)
91 }) 93 })
92 94
95 it('Should run filter:api.accounts.videos.list.params', async function () {
96 const res = await getAccountVideos(servers[0].url, servers[0].accessToken, 'root', 0, 2)
97
98 // 1 plugin do +1 to the count parameter
99 expect(res.body.data).to.have.lengthOf(3)
100 })
101
102 it('Should run filter:api.accounts.videos.list.result', async function () {
103 const res = await getAccountVideos(servers[0].url, servers[0].accessToken, 'root', 0, 2)
104
105 // Plugin do +2 to the total result
106 expect(res.body.total).to.equal(12)
107 })
108
109 it('Should run filter:api.video-channels.videos.list.params', async function () {
110 const res = await getVideoChannelVideos(servers[0].url, servers[0].accessToken, 'root_channel', 0, 2)
111
112 // 1 plugin do +3 to the count parameter
113 expect(res.body.data).to.have.lengthOf(5)
114 })
115
116 it('Should run filter:api.video-channels.videos.list.result', async function () {
117 const res = await getAccountVideos(servers[0].url, servers[0].accessToken, 'root_channel', 0, 2)
118
119 // Plugin do +3 to the total result
120 expect(res.body.total).to.equal(13)
121 })
122
93 it('Should run filter:api.video.get.result', async function () { 123 it('Should run filter:api.video.get.result', async function () {
94 const res = await getVideo(servers[0].url, videoUUID) 124 const res = await getVideo(servers[0].url, videoUUID)
95 125