cleanupTests,
createMultipleServers,
doubleFollow,
+ makeActivityPubGetRequest,
makeGetRequest,
makeRawRequest,
PeerTubeServer,
let videoPlaylistUUID: string
before(async function () {
- this.timeout(60000)
+ this.timeout(120000)
servers = await createMultipleServers(2)
await setAccessTokensToServers(servers)
})
})
+ describe('Client HTML filters', function () {
+ let videoUUID: string
+
+ before(async function () {
+ this.timeout(60000)
+
+ const { uuid } = await servers[0].videos.quickUpload({ name: 'html video' })
+ videoUUID = uuid
+ })
+
+ it('Should run filter:html.client.json-ld.result', async function () {
+ const res = await makeGetRequest({ url: servers[0].url, path: '/w/' + videoUUID, expectedStatus: HttpStatusCode.OK_200 })
+ expect(res.text).to.contain('"recordedAt":"http://example.com/recordedAt"')
+ })
+
+ it('Should not run filter:html.client.json-ld.result with an account', async function () {
+ const res = await makeGetRequest({ url: servers[0].url, path: '/a/root', expectedStatus: HttpStatusCode.OK_200 })
+ expect(res.text).not.to.contain('"recordedAt":"http://example.com/recordedAt"')
+ })
+ })
+
describe('Search filters', function () {
before(async 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 => {
+ return typeof c === 'object' && c.recordedAt === 'https://schema.org/recordedAt'
+ })).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)
})