|
|
|
@ -29,7 +29,8 @@ import {
|
|
|
|
|
randomString,
|
|
|
|
|
registerUser,
|
|
|
|
|
API,
|
|
|
|
|
getSite
|
|
|
|
|
getSite,
|
|
|
|
|
unfollows
|
|
|
|
|
} from './shared';
|
|
|
|
|
import { PostView, CommunityView } from 'lemmy-js-client';
|
|
|
|
|
|
|
|
|
@ -46,13 +47,6 @@ afterAll(async () => {
|
|
|
|
|
await unfollows();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
async function unfollows() {
|
|
|
|
|
await unfollowRemotes(alpha);
|
|
|
|
|
await unfollowRemotes(gamma);
|
|
|
|
|
await unfollowRemotes(delta);
|
|
|
|
|
await unfollowRemotes(epsilon);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function assertPostFederation(postOne: PostView, postTwo: PostView) {
|
|
|
|
|
expect(postOne.post.ap_id).toBe(postTwo.post.ap_id);
|
|
|
|
|
expect(postOne.post.name).toBe(postTwo.post.name);
|
|
|
|
@ -291,14 +285,6 @@ test('Search for a post', async () => {
|
|
|
|
|
expect(betaPost.post.name).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('A and G subscribe to B (center) A posts, it gets announced to G', async () => {
|
|
|
|
|
let postRes = await createPost(alpha, betaCommunity.community.id);
|
|
|
|
|
expect(postRes.post_view.post).toBeDefined();
|
|
|
|
|
|
|
|
|
|
let betaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
|
|
|
|
|
expect(betaPost.post.name).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Enforce site ban for federated user', async () => {
|
|
|
|
|
// create a test user
|
|
|
|
|
let alphaUserJwt = await registerUser(alpha);
|
|
|
|
@ -384,6 +370,15 @@ test('Enforce community ban for federated user', async () => {
|
|
|
|
|
expect(searchBeta2.posts[0]).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('A and G subscribe to B (center) A posts, it gets announced to G', async () => {
|
|
|
|
|
let postRes = await createPost(alpha, betaCommunity.community.id);
|
|
|
|
|
expect(postRes.post_view.post).toBeDefined();
|
|
|
|
|
|
|
|
|
|
let betaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
|
|
|
|
|
expect(betaPost.post.name).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('Report a post', async () => {
|
|
|
|
|
let betaCommunity = (await resolveBetaCommunity(beta)).community;
|
|
|
|
|
let postRes = await createPost(beta, betaCommunity.community.id);
|
|
|
|
|