X-Git-Url: http://these/git/?a=blobdiff_plain;f=api_tests%2Fsrc%2Fcommunity.spec.ts;h=723f3bb3f543e5699c83b71466f616d9d0fc5d34;hb=9c3efe32e7b2ef7978b7957eac10691beb551dde;hp=e1f6825ae8ab9fc369061b26309984d314b12572;hpb=becb8b4f66bdacca23b0b169e07d845afcb3d204;p=lemmy.git diff --git a/api_tests/src/community.spec.ts b/api_tests/src/community.spec.ts index e1f6825a..723f3bb3 100644 --- a/api_tests/src/community.spec.ts +++ b/api_tests/src/community.spec.ts @@ -1,4 +1,6 @@ jest.setTimeout(120000); +import { CommunityView } from 'lemmy-js-client'; + import { alpha, beta, @@ -10,7 +12,6 @@ import { getCommunity, followCommunity, } from './shared'; -import { CommunityView } from 'lemmy-js-client'; beforeAll(async () => { await setupLogins(); @@ -23,11 +24,11 @@ function assertCommunityFederation( expect(communityOne.community.actor_id).toBe(communityTwo.community.actor_id); expect(communityOne.community.name).toBe(communityTwo.community.name); expect(communityOne.community.title).toBe(communityTwo.community.title); - expect(communityOne.community.description).toBe( - communityTwo.community.description + expect(communityOne.community.description.unwrapOr("none")).toBe( + communityTwo.community.description.unwrapOr("none") ); - expect(communityOne.community.icon).toBe(communityTwo.community.icon); - expect(communityOne.community.banner).toBe(communityTwo.community.banner); + expect(communityOne.community.icon.unwrapOr("none")).toBe(communityTwo.community.icon.unwrapOr("none")); + expect(communityOne.community.banner.unwrapOr("none")).toBe(communityTwo.community.banner.unwrapOr("none")); expect(communityOne.community.published).toBe( communityTwo.community.published ); @@ -47,7 +48,7 @@ test('Create community', async () => { // Cache the community on beta, make sure it has the other fields let searchShort = `!${prevName}@lemmy-alpha:8541`; - let betaCommunity = (await resolveCommunity(beta, searchShort)).community; + let betaCommunity = (await resolveCommunity(beta, searchShort)).community.unwrap(); assertCommunityFederation(betaCommunity, communityRes.community_view); }); @@ -56,7 +57,7 @@ test('Delete community', async () => { // Cache the community on Alpha let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`; - let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community; + let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community.unwrap(); assertCommunityFederation(alphaCommunity, communityRes.community_view); // Follow the community from alpha @@ -107,7 +108,7 @@ test('Remove community', async () => { // Cache the community on Alpha let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`; - let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community; + let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community.unwrap(); assertCommunityFederation(alphaCommunity, communityRes.community_view); // Follow the community from alpha @@ -158,6 +159,6 @@ test('Search for beta community', async () => { expect(communityRes.community_view.community.name).toBeDefined(); let searchShort = `!${communityRes.community_view.community.name}@lemmy-beta:8551`; - let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community; + let alphaCommunity = (await resolveCommunity(alpha, searchShort)).community.unwrap(); assertCommunityFederation(alphaCommunity, communityRes.community_view); });