Add filter:html.client.json-ld.result hook

This commit is contained in:
Chocobozzz
2023-03-24 18:37:55 +01:00
parent 80d7d180a3
commit d91ce83d39
4 changed files with 55 additions and 11 deletions

View File

@@ -605,6 +605,27 @@ describe('Test plugin filter hooks', function () {
})
})
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 () {