From 2b02a9b98cfc93a01b52ad6cb893e3d089fec472 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Mar 2023 15:45:31 +0100 Subject: [PATCH] Fix tests --- server/tests/fixtures/peertube-plugin-test/main.js | 2 +- server/tests/plugins/filter-hooks.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index 6d06ec17d..5325e14c4 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js @@ -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({ diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index ab3a6a093..4d26ff8b7 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts @@ -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 () {