]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix tests
authorChocobozzz <me@florianbigard.com>
Fri, 10 Mar 2023 14:45:31 +0000 (15:45 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 10 Mar 2023 14:45:52 +0000 (15:45 +0100)
server/tests/fixtures/peertube-plugin-test/main.js
server/tests/plugins/filter-hooks.ts

index 6d06ec17d1a8f3e7d3dc33d926999418d6fcac0a..5325e14c4161c59e61e7f42ef9d885a859b612ae 100644 (file)
@@ -209,7 +209,7 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
 
   registerHook({
     target: 'filter:activity-pub.activity.context.build.result',
-    handler: context => context.concat([ 'https://example.com/new-context' ])
+    handler: context => context.concat([ { recordedAt: 'https://schema.org/recordedAt' } ])
   })
 
   registerHook({
index ab3a6a093be41711ebb80a7ca0d734da691ae1e2..4d26ff8b739785d925a962e668576f3b3fa69b26 100644 (file)
@@ -853,7 +853,9 @@ describe('Test plugin filter hooks', 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
+      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 () {