1 jest.setTimeout(120000);
12 beforeAll(async () => {
16 afterAll(async () => {
17 await unfollowRemotes(alpha);
20 test("Follow federated community", async () => {
21 let betaCommunity = (await resolveBetaCommunity(alpha)).community;
23 throw "Missing beta community";
25 await followCommunity(alpha, true, betaCommunity.community.id);
26 betaCommunity = (await resolveBetaCommunity(alpha)).community;
28 // Make sure the follow response went through
29 expect(betaCommunity?.community.local).toBe(false);
30 expect(betaCommunity?.community.name).toBe("main");
31 expect(betaCommunity?.subscribed).toBe("Subscribed");
33 // Check it from local
34 let site = await getSite(alpha);
35 let remoteCommunityId = site.my_user?.follows.find(
36 c => c.community.local == false,
38 expect(remoteCommunityId).toBeDefined();
39 expect(site.my_user?.follows.length).toBe(2);
41 if (!remoteCommunityId) {
42 throw "Missing remote community id";
46 let unfollow = await followCommunity(alpha, false, remoteCommunityId);
47 expect(unfollow.community_view.subscribed).toBe("NotSubscribed");
49 // Make sure you are unsubbed locally
50 let siteUnfollowCheck = await getSite(alpha);
51 expect(siteUnfollowCheck.my_user?.follows.length).toBe(1);