feat: assert actors when mocking post

This commit is contained in:
Julian Lam
2024-06-14 12:22:06 -04:00
parent 3f1b04ebe8
commit f5b856f4fd

View File

@@ -90,6 +90,9 @@ Mocks.post = async (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) => {
if (!activitypub._constants.acceptedPostTypes.includes(object.type)) {
return null;