"eslint": "^7.30.0",
"eslint-plugin-jane": "^9.0.3",
"jest": "^27.0.6",
- "lemmy-js-client": "0.16.0-rc.1",
+ "lemmy-js-client": "0.17.0-rc.1",
"node-fetch": "^2.6.1",
"prettier": "^2.3.2",
"ts-jest": "^27.0.3",
test('Check that activity from another instance is sent to third instance', async () => {
// Alpha and gamma users follow beta community
let alphaFollow = await followBeta(alpha);
- expect(alphaFollow.community_view.community.local).toBe(false);
- expect(alphaFollow.community_view.community.name).toBe('main');
+ expect(alphaFollow.community_follower_view.community.local).toBe(false);
+ expect(alphaFollow.community_follower_view.community.name).toBe('main');
let gammaFollow = await followBeta(gamma);
- expect(gammaFollow.community_view.community.local).toBe(false);
- expect(gammaFollow.community_view.community.name).toBe('main');
+ expect(gammaFollow.community_follower_view.community.local).toBe(false);
+ expect(gammaFollow.community_follower_view.community.name).toBe('main');
// Create a post on beta
let betaPost = await createPost(beta, 2);
// Follow beta again
let follow = await followBeta(alpha);
- expect(follow.community_view.community.local).toBe(false);
- expect(follow.community_view.community.name).toBe('main');
+ expect(follow.community_follower_view.community.local).toBe(false);
+ expect(follow.community_follower_view.community.name).toBe('main');
// An update to the child comment on beta, should push the post, parent, and child to alpha now
let updatedCommentContent = 'An update child comment from beta';
);
// Make sure the follow response went through
- expect(follow.community_view.community.local).toBe(false);
+ expect(follow.community_follower_view.community.local).toBe(false);
let deleteCommunityRes = await deleteCommunity(
beta,
);
// Make sure the follow response went through
- expect(follow.community_view.community.local).toBe(false);
+ expect(follow.community_follower_view.community.local).toBe(false);
let removeCommunityRes = await removeCommunity(
beta,
);
// Make sure the follow response went through
- expect(follow.community_view.community.local).toBe(false);
- expect(follow.community_view.community.name).toBe('main');
+ expect(follow.community_follower_view.community.local).toBe(false);
+ expect(follow.community_follower_view.community.name).toBe('main');
+ expect(follow.community_follower_view.pending).toBe(true);
// Check it from local
let site = await getSite(alpha);
// Test an unfollow
let unfollow = await followCommunity(alpha, false, remoteCommunityId);
- expect(unfollow.community_view.community.local).toBe(false);
+ expect(unfollow.community_follower_view.community.local).toBe(false);
// Make sure you are unsubbed locally
let siteUnfollowCheck = await getSite(alpha);
expect(removePostRes.post_view.post.removed).toBe(true);
// Make sure lemmy alpha sees post is removed
- let alphaPost = await getPost(alpha, postRes.post_view.post.id);
+ // let alphaPost = await getPost(alpha, postRes.post_view.post.id);
// expect(alphaPost.post_view.post.removed).toBe(true); // TODO this shouldn't be commented
// assertPostFederation(alphaPost.post_view, removePostRes.post_view);
PostResponse,
SearchResponse,
FollowCommunity,
+ FollowCommunityResponse,
CommunityResponse,
GetPostResponse,
Register,
api: API,
person_id: number,
ban: boolean,
- remove_data: boolean,
+ remove_data: boolean
): Promise<BanPersonResponse> {
// Make sure lemmy-beta/c/main is cached on lemmy_alpha
let form: BanPerson = {
api: API,
follow: boolean,
community_id: number
-): Promise<CommunityResponse> {
+): Promise<FollowCommunityResponse> {
let form: FollowCommunity = {
community_id,
follow,
}
export async function deleteUser(
- api: API,
+ api: API
): Promise<DeleteAccountResponse> {
let form: DeleteAccount = {
auth: api.auth,
return siteRes;
}
-export async function followBeta(api: API): Promise<CommunityResponse> {
+export async function followBeta(api: API): Promise<FollowCommunityResponse> {
let betaCommunity = (await resolveBetaCommunity(api)).community;
if (betaCommunity) {
let follow = await followCommunity(api, true, betaCommunity.community.id);
export async function reportPost(
api: API,
post_id: number,
- reason: string,
+ reason: string
): Promise<PostReportResponse> {
let form: CreatePostReport = {
post_id,
export async function reportComment(
api: API,
comment_id: number,
- reason: string,
+ reason: string
): Promise<CommentReportResponse> {
let form: CreateCommentReport = {
comment_id,
saveUserSettings,
getSite,
createPost,
- gamma,
+ // gamma,
resolveCommunity,
createComment,
resolveBetaCommunity,
dependencies:
language-subtag-registry "~0.3.2"
-lemmy-js-client@0.16.0-rc.1:
- version "0.16.0-rc.1"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.16.0-rc.1.tgz#14c4a526abf4b171c8afe4efbe2a62dcaf6a6f17"
- integrity sha512-0hR/gHHsokp46whIHGMBQO2zBKWM7bT6mwKNMZxPvyJo+YW9EbKTO5edjF5E4v8nf3FuIE+gFtm5NFAjCaeWJg==
+lemmy-js-client@0.17.0-rc.1:
+ version "0.17.0-rc.1"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.1.tgz#153fae5a06f047fe59a00847589b80736a30277b"
+ integrity sha512-dHkL5eXHTSxchyxn8yXj33iuh1UQ8OmebUJY6PstQPxL8ZOFBKlVEJs8UlXBJgeDkDTc2OObNpUd2uFqhEt6jg==
leven@^3.1.0:
version "3.1.0"