diff options
author | Chocobozzz <me@florianbigard.com> | 2023-03-24 18:37:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-03-24 18:37:55 +0100 |
commit | d91ce83d392801fd592adeb08a7674b4017ffe82 (patch) | |
tree | 19d6d629a9b63ce01441e271b654acefcea1b636 /server/tests/plugins | |
parent | 80d7d180a368dc966bba383f3117ed131f5e0d42 (diff) | |
download | PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.tar.gz PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.tar.zst PeerTube-d91ce83d392801fd592adeb08a7674b4017ffe82.zip |
Add filter:html.client.json-ld.result hook
Diffstat (limited to 'server/tests/plugins')
-rw-r--r-- | server/tests/plugins/filter-hooks.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index 4d26ff8b7..43749b0b5 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -605,6 +605,27 @@ describe('Test plugin filter hooks', function () { | |||
605 | }) | 605 | }) |
606 | }) | 606 | }) |
607 | 607 | ||
608 | describe('Client HTML filters', function () { | ||
609 | let videoUUID: string | ||
610 | |||
611 | before(async function () { | ||
612 | this.timeout(60000) | ||
613 | |||
614 | const { uuid } = await servers[0].videos.quickUpload({ name: 'html video' }) | ||
615 | videoUUID = uuid | ||
616 | }) | ||
617 | |||
618 | it('Should run filter:html.client.json-ld.result', async function () { | ||
619 | const res = await makeGetRequest({ url: servers[0].url, path: '/w/' + videoUUID, expectedStatus: HttpStatusCode.OK_200 }) | ||
620 | expect(res.text).to.contain('"recordedAt":"http://example.com/recordedAt"') | ||
621 | }) | ||
622 | |||
623 | it('Should not run filter:html.client.json-ld.result with an account', async function () { | ||
624 | const res = await makeGetRequest({ url: servers[0].url, path: '/a/root', expectedStatus: HttpStatusCode.OK_200 }) | ||
625 | expect(res.text).not.to.contain('"recordedAt":"http://example.com/recordedAt"') | ||
626 | }) | ||
627 | }) | ||
628 | |||
608 | describe('Search filters', function () { | 629 | describe('Search filters', function () { |
609 | 630 | ||
610 | before(async function () { | 631 | before(async function () { |