]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/filter-hooks.ts
Fix tests
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / filter-hooks.ts
index 4d26ff8b739785d925a962e668576f3b3fa69b26..a02a53c5049afafc91540bd290e5d2861e3cce71 100644 (file)
@@ -32,7 +32,7 @@ describe('Test plugin filter hooks', function () {
   let videoPlaylistUUID: string
 
   before(async function () {
-    this.timeout(60000)
+    this.timeout(120000)
 
     servers = await createMultipleServers(2)
     await setAccessTokensToServers(servers)
@@ -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 () {