fix: failing test due to expected thrown exception

This commit is contained in:
Julian Lam
2026-04-09 17:36:03 -04:00
parent ef2a17f25d
commit 5f5fa0930d
2 changed files with 13 additions and 3 deletions

View File

@@ -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 () {

View File

@@ -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);