]> Untitled Git - lemmy.git/blobdiff - api_tests/src/community.spec.ts
Isomorphic docker (#1124)
[lemmy.git] / api_tests / src / community.spec.ts
similarity index 80%
rename from ui/src/api_tests/community.spec.ts
rename to api_tests/src/community.spec.ts
index bd498009a98a43b589ec684252d9e8bfc2a75efe..f1cbf8db708bcd7214ed26d1da0f0998d7ba78bb 100644 (file)
@@ -1,8 +1,10 @@
+jest.setTimeout(120000);
 import {
   alpha,
   beta,
   setupLogins,
   searchForBetaCommunity,
+  searchForCommunity,
   createCommunity,
   deleteCommunity,
   removeCommunity,
@@ -21,6 +23,17 @@ test('Create community', async () => {
   let prevName = communityRes.community.name;
   let communityRes2 = await createCommunity(alpha, prevName);
   expect(communityRes2['error']).toBe('community_already_exists');
+  await delay();
+
+  // Cache the community on beta, make sure it has the other fields
+  let searchShort = `!${prevName}@lemmy-alpha:8541`;
+  let search = await searchForCommunity(beta, searchShort);
+  let communityOnBeta = search.communities[0];
+  expect(communityOnBeta.name).toBe(communityRes.community.name);
+  expect(communityOnBeta.title).toBe(communityRes.community.title);
+  expect(communityOnBeta.description).toBe(communityRes.community.description);
+  expect(communityOnBeta.icon).toBe(communityRes.community.icon);
+  expect(communityOnBeta.banner).toBe(communityRes.community.banner);
 });
 
 test('Delete community', async () => {