mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
test: have ap helper mocks for person and group auto-save to ap cache
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 };
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user