5 searchForBetaCommunity,
12 beforeAll(async () => {
16 test('Create community', async () => {
17 let communityRes = await createCommunity(alpha);
18 expect(communityRes.community.name).toBeDefined();
21 let prevName = communityRes.community.name;
22 let communityRes2 = await createCommunity(alpha, prevName);
23 expect(communityRes2['error']).toBe('community_already_exists');
26 test('Delete community', async () => {
27 let communityRes = await createCommunity(beta);
29 let deleteCommunityRes = await deleteCommunity(
32 communityRes.community.id
34 expect(deleteCommunityRes.community.deleted).toBe(true);
37 // Make sure it got deleted on A
38 let search = await searchForBetaCommunity(alpha);
39 let communityA = search.communities[0];
40 // TODO this fails currently, because no updates are pushed
41 // expect(communityA.deleted).toBe(true);
44 let undeleteCommunityRes = await deleteCommunity(
47 communityRes.community.id
49 expect(undeleteCommunityRes.community.deleted).toBe(false);
52 // Make sure it got undeleted on A
53 let search2 = await searchForBetaCommunity(alpha);
54 let communityA2 = search2.communities[0];
55 // TODO this fails currently, because no updates are pushed
56 // expect(communityA2.deleted).toBe(false);
59 test('Remove community', async () => {
60 let communityRes = await createCommunity(beta);
62 let removeCommunityRes = await removeCommunity(
65 communityRes.community.id
67 expect(removeCommunityRes.community.removed).toBe(true);
69 // Make sure it got removed on A
70 let search = await searchForBetaCommunity(alpha);
71 let communityA = search.communities[0];
72 // TODO this fails currently, because no updates are pushed
73 // expect(communityA.removed).toBe(true);
77 let unremoveCommunityRes = await removeCommunity(
80 communityRes.community.id
82 expect(unremoveCommunityRes.community.removed).toBe(false);
85 // Make sure it got unremoved on A
86 let search2 = await searchForBetaCommunity(alpha);
87 let communityA2 = search2.communities[0];
88 // TODO this fails currently, because no updates are pushed
89 // expect(communityA2.removed).toBe(false);
92 test('Search for beta community', async () => {
93 let search = await searchForBetaCommunity(alpha);
94 expect(search.communities[0].name).toBe('main');