X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fplugins%2Ffilter-hooks.ts;h=80014566bf53883f3e6fa4ae0ea60c05466f2142;hb=650580504cf14a87bd4025eec9673eb5642dc71d;hp=c00ac8f91701a9d7cfd20a1efe21fa00fba870dc;hpb=a24bd1ed41b43790bab6ba789580bb4e85f07d85;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index c00ac8f91..80014566b 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts @@ -255,6 +255,14 @@ describe('Test plugin filter hooks', function () { expect(thread.comment.text.endsWith(' <3')).to.be.true }) + it('Should run filter:api.overviews.videos.list.{params,result}', async function () { + await servers[0].overviews.getVideos({ page: 1 }) + + // 3 because we get 3 samples per page + await servers[0].servers.waitUntilLog('Run hook filter:api.overviews.videos.list.params', 3) + await servers[0].servers.waitUntilLog('Run hook filter:api.overviews.videos.list.result', 3) + }) + describe('Should run filter:video.auto-blacklist.result', function () { async function checkIsBlacklisted (id: number | string, value: boolean) { @@ -529,6 +537,16 @@ describe('Test plugin filter hooks', function () { }) }) + describe('Stats filters', function () { + + it('Should run filter:api.server.stats.get.result', async function () { + const data = await servers[0].stats.get() + + expect((data as any).customStats).to.equal(14) + }) + + }) + after(async function () { await cleanupTests(servers) })