From 5f5fa0930d43ed4b6cbe8623e048d330da0ed58e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 9 Apr 2026 17:36:03 -0400 Subject: [PATCH] fix: failing test due to expected thrown exception --- test/activitypub/inbox.js | 6 +++++- test/activitypub/privileges.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/activitypub/inbox.js b/test/activitypub/inbox.js index f70d10db79..0a4c46691d 100644 --- a/test/activitypub/inbox.js +++ b/test/activitypub/inbox.js @@ -464,7 +464,11 @@ describe('Inbox', () => { const object = await activitypub.mocks.notes.public(this.postData); const { activity } = helpers.mocks.like({ object }); this.voterUid = activity.actor; - await activitypub.inbox.like({ body: activity }); + try { + await activitypub.inbox.like({ body: activity }); + } catch (e) { + // expected + } }); after(async function () { diff --git a/test/activitypub/privileges.js b/test/activitypub/privileges.js index db6579ac5c..134be6c46f 100644 --- a/test/activitypub/privileges.js +++ b/test/activitypub/privileges.js @@ -122,7 +122,10 @@ describe('Privilege logic for remote users/content (ActivityPub)', () => { object: note, })); - await activitypub.inbox.update({ body: activity }); + assert.rejects( + activitypub.inbox.update({ body: activity }), + { message: '[[error:no-privileges]]' }, + ); const postData = await posts.getPostData(note.id); assert.strictEqual(postData.content, oldContent); @@ -154,7 +157,10 @@ describe('Privilege logic for remote users/content (ActivityPub)', () => { it('should ignore remote deletion of said note', async () => { ({ activity } = helpers.mocks.delete({ object: note })); - await activitypub.inbox.delete({ body: activity }); + assert.rejects( + activitypub.inbox.delete({ body: activity }), + { message: '[[error:no-privileges]]' }, + ); const exists = await posts.exists(note.id); assert.strictEqual(exists, true);