]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/filter-hooks.ts
Add user video list hooks
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / filter-hooks.ts
index cdde6cd30aeda589eeec4c00c4a11925311750c7..d88170201d7df69f55fb4c86b0f239f02ecbe052 100644 (file)
@@ -10,6 +10,7 @@ import {
   doubleFollow,
   getAccountVideos,
   getConfig,
+  getMyVideos,
   getPluginTestPath,
   getVideo,
   getVideoChannelVideos,
@@ -121,6 +122,20 @@ describe('Test plugin filter hooks', function () {
     expect(res.body.total).to.equal(13)
   })
 
+  it('Should run filter:api.user.me.videos.list.params', async function () {
+    const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 2)
+
+    // 1 plugin do +4 to the count parameter
+    expect(res.body.data).to.have.lengthOf(6)
+  })
+
+  it('Should run filter:api.user.me.videos.list.result', async function () {
+    const res = await getMyVideos(servers[0].url, servers[0].accessToken, 0, 2)
+
+    // Plugin do +4 to the total result
+    expect(res.body.total).to.equal(14)
+  })
+
   it('Should run filter:api.video.get.result', async function () {
     const res = await getVideo(servers[0].url, videoUUID)