Add server hooks for listing subscription

This commit is contained in:
Wicklow
2023-02-24 16:21:26 +01:00
committed by Chocobozzz
parent d41f4a6dc6
commit c0687c91b9
4 changed files with 40 additions and 2 deletions

View File

@@ -71,6 +71,9 @@ describe('Test plugin filter hooks', function () {
}
}
})
// Root subscribes to itself
await servers[0].subscriptions.add({ targetUri: 'root_channel@' + servers[0].host })
})
describe('Videos', function () {
@@ -151,6 +154,20 @@ describe('Test plugin filter hooks', function () {
expect(total).to.equal(14)
})
it('Should run filter:api.user.me.subscription-videos.list.params', async function () {
const { data } = await servers[0].subscriptions.listVideos()
// 1 plugin set the count parameter to 1
expect(data).to.have.lengthOf(1)
})
it('Should run filter:api.user.me.subscription-videos.list.result', async function () {
const { total } = await servers[0].subscriptions.listVideos()
// Plugin do +4 to the total result
expect(total).to.equal(14)
})
it('Should run filter:api.video.get.result', async function () {
const video = await servers[0].videos.get({ id: videoUUID })
expect(video.name).to.contain('<3')