mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: assert actors when mocking post
This commit is contained in:
@@ -90,6 +90,9 @@ Mocks.post = async (objects) => {
|
|||||||
objects = [objects];
|
objects = [objects];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const actorIds = new Set(objects.map(object => object.attributedTo).filter(Boolean));
|
||||||
|
await activitypub.actors.assert(Array.from(actorIds));
|
||||||
|
|
||||||
const posts = await Promise.all(objects.map(async (object) => {
|
const posts = await Promise.all(objects.map(async (object) => {
|
||||||
if (!activitypub._constants.acceptedPostTypes.includes(object.type)) {
|
if (!activitypub._constants.acceptedPostTypes.includes(object.type)) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user