mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 19:07:08 +02:00
fix: failing test due to expected thrown exception
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user