1 jest.setTimeout(120000);
11 beforeAll(async () => {
15 afterAll(async () => {
16 await unfollowRemotes(alpha);
19 test('Follow federated community', async () => {
20 let betaCommunity = (await resolveBetaCommunity(alpha)).community;
21 let follow = await followCommunity(
24 betaCommunity.community.id
27 // Make sure the follow response went through
28 expect(follow.community_follower_view.community.local).toBe(false);
29 expect(follow.community_follower_view.community.name).toBe('main');
30 expect(follow.community_follower_view.pending).toBe(true);
32 // Check it from local
33 let site = await getSite(alpha);
34 let remoteCommunityId = site.my_user.follows.find(
35 c => c.community.local == false
37 expect(remoteCommunityId).toBeDefined();
40 let unfollow = await followCommunity(alpha, false, remoteCommunityId);
41 expect(unfollow.community_follower_view).toBeNull()
43 // Make sure you are unsubbed locally
44 let siteUnfollowCheck = await getSite(alpha);
45 expect(siteUnfollowCheck.my_user.follows.length).toBeGreaterThanOrEqual(1);