mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add test on AP hooks
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
cleanupTests,
|
||||
createMultipleServers,
|
||||
doubleFollow,
|
||||
makeActivityPubGetRequest,
|
||||
makeGetRequest,
|
||||
makeRawRequest,
|
||||
PeerTubeServer,
|
||||
@@ -846,6 +847,22 @@ describe('Test plugin filter hooks', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Activity Pub', function () {
|
||||
|
||||
it('Should run filter:activity-pub.activity.context.build.result', async function () {
|
||||
const { body } = await makeActivityPubGetRequest(servers[0].url, '/w/' + videoUUID)
|
||||
expect(body.type).to.equal('Video')
|
||||
|
||||
expect(body['@context'].some(c => c === 'https://example.com/new-context')).to.be.true
|
||||
})
|
||||
|
||||
it('Should run filter:activity-pub.video.json-ld.build.result', async function () {
|
||||
const { body } = await makeActivityPubGetRequest(servers[0].url, '/w/' + videoUUID)
|
||||
expect(body.name).to.equal('default video 0')
|
||||
expect(body.videoName).to.equal('default video 0')
|
||||
})
|
||||
})
|
||||
|
||||
after(async function () {
|
||||
await cleanupTests(servers)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user