test: have ap helper mocks for person and group auto-save to ap cache

This commit is contained in:
Julian Lam
2025-03-18 10:18:38 -04:00
parent afc4764358
commit 80069a198c
4 changed files with 4 additions and 4 deletions

View File

@@ -111,7 +111,6 @@ describe.only('Group assertion', () => {
before(async () => {
const { id, actor } = helpers.mocks.group();
actorUri = id;
activitypub._cache.set(`0;${id}`, actor);
});
it('should assert a uri identifying as "Group" into a remote category', async () => {

View File

@@ -38,7 +38,6 @@ describe('FEPs', () => {
uid = await user.create({ username: utils.generateUUID() });
const { id: followerId, actor } = helpers.mocks.person();
activitypub._cache.set(`0;${followerId}`, actor);
user.setCategoryWatchState(followerId, [cid], categories.watchStates.tracking);
activitypub._sent.clear();

View File

@@ -34,6 +34,8 @@ Helpers.mocks.person = () => {
},
};
activitypub._cache.set(`0;${id}`, actor);
return { id, actor };
};
@@ -41,6 +43,8 @@ Helpers.mocks.group = () => {
const { id, actor } = Helpers.mocks.person();
actor.type = 'Group';
activitypub._cache.set(`0;${id}`, actor);
return { id, actor };
};

View File

@@ -85,7 +85,6 @@ describe('Notes', () => {
it('should slot newly created topic in remote category if addressed', async () => {
const { id: cid, actor } = helpers.mocks.group();
activitypub._cache.set(`0;${cid}`, actor);
await activitypub.actors.assertGroup([cid]);
const { id } = helpers.mocks.note({
@@ -120,7 +119,6 @@ describe('Notes', () => {
// Remote
const { id, actor } = helpers.mocks.group();
remoteCid = id;
activitypub._cache.set(`0;${id}`, actor);
await activitypub.actors.assertGroup([id]);
// User