From 80069a198c7cf96cbe48afe6df4d4e508a84c11d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 18 Mar 2025 10:18:38 -0400 Subject: [PATCH] test: have ap helper mocks for person and group auto-save to ap cache --- test/activitypub/actors.js | 1 - test/activitypub/feps.js | 1 - test/activitypub/helpers.js | 4 ++++ test/activitypub/notes.js | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/activitypub/actors.js b/test/activitypub/actors.js index 02ab5ffce4..ab3438225e 100644 --- a/test/activitypub/actors.js +++ b/test/activitypub/actors.js @@ -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 () => { diff --git a/test/activitypub/feps.js b/test/activitypub/feps.js index 2df2b99587..a9b42644d8 100644 --- a/test/activitypub/feps.js +++ b/test/activitypub/feps.js @@ -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(); diff --git a/test/activitypub/helpers.js b/test/activitypub/helpers.js index 6873dc0340..6652ac63ee 100644 --- a/test/activitypub/helpers.js +++ b/test/activitypub/helpers.js @@ -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 }; }; diff --git a/test/activitypub/notes.js b/test/activitypub/notes.js index e8198d946b..c9c5e42e7b 100644 --- a/test/activitypub/notes.js +++ b/test/activitypub/notes.js @@ -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