Skip to content

Commit

Permalink
Let federation modify groups
Browse files Browse the repository at this point in the history
* Don't check if group is local

* Add API test for mods modifying communities
  • Loading branch information
flamingo-cant-draw committed Nov 25, 2024
1 parent 41bd830 commit 3ebbe73
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions api_tests/src/community.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,41 @@ test("Remote mods can edit communities", async () => {
"Example description",
);
});

test("Remote mods can edit communities", async () => {
let communityRes = await createCommunity(alpha);

let betaCommunity = await resolveCommunity(
beta,
communityRes.community_view.community.actor_id,
);
if (!betaCommunity.community) {
throw "Missing beta community";
}
let betaOnAlpha = await resolvePerson(alpha, "lemmy_beta@lemmy-beta:8551");

let form: AddModToCommunity = {
community_id: communityRes.community_view.community.id,
person_id: betaOnAlpha.person?.person.id as number,
added: true,
};
alpha.addModToCommunity(form);

let form2: EditCommunity = {
community_id: betaCommunity.community?.community.id as number,
description: "Example description",
};

await editCommunity(beta, form2);
// give alpha time to get and process the edit
await delay(1000);

let alphaCommunity = await getCommunity(
alpha,
communityRes.community_view.community.id,
);

await expect(alphaCommunity.community_view.community.description).toBe(
"Example description",
);
});

0 comments on commit 3ebbe73

Please sign in to comment.