mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add server hooks for listing subscription
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user