diff options
Diffstat (limited to 'server/tests/plugins')
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 30 |
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 | ||