4 searchForBetaCommunity,
6 checkFollowedCommunities,
11 beforeAll(async () => {
15 afterAll(async () => {
16 await unfollowRemotes(alpha);
19 test('Follow federated community', async () => {
20 let search = await searchForBetaCommunity(alpha); // TODO sometimes this is returning null?
21 let follow = await followCommunity(alpha, true, search.communities[0].id);
23 // Make sure the follow response went through
24 expect(follow.community.local).toBe(false);
25 expect(follow.community.name).toBe('main');
28 // Check it from local
29 let followCheck = await checkFollowedCommunities(alpha);
30 let remoteCommunityId = followCheck.communities.filter(
31 c => c.community_local == false
33 expect(remoteCommunityId).toBeDefined();
36 let unfollow = await followCommunity(alpha, false, remoteCommunityId);
37 expect(unfollow.community.local).toBe(false);
40 // Make sure you are unsubbed locally
41 let unfollowCheck = await checkFollowedCommunities(alpha);
42 expect(unfollowCheck.communities.length).toBeGreaterThanOrEqual(1);