|
|
@ -37,9 +37,11 @@ import {
|
|
|
|
waitForPost,
|
|
|
|
waitForPost,
|
|
|
|
alphaUrl,
|
|
|
|
alphaUrl,
|
|
|
|
loginUser,
|
|
|
|
loginUser,
|
|
|
|
|
|
|
|
createCommunity,
|
|
|
|
|
|
|
|
getPosts,
|
|
|
|
} from "./shared";
|
|
|
|
} from "./shared";
|
|
|
|
import { PostView } from "lemmy-js-client/dist/types/PostView";
|
|
|
|
import { PostView } from "lemmy-js-client/dist/types/PostView";
|
|
|
|
import { EditSite, ResolveObject } from "lemmy-js-client";
|
|
|
|
import { EditSite, ListingType, ResolveObject } from "lemmy-js-client";
|
|
|
|
|
|
|
|
|
|
|
|
let betaCommunity: CommunityView | undefined;
|
|
|
|
let betaCommunity: CommunityView | undefined;
|
|
|
|
|
|
|
|
|
|
|
@ -225,6 +227,26 @@ test("Sticky a post", async () => {
|
|
|
|
expect(betaPost3?.post.featured_community).toBe(false);
|
|
|
|
expect(betaPost3?.post.featured_community).toBe(false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test("Collection of featured posts gets federated", async () => {
|
|
|
|
|
|
|
|
// create a new community and feature a post
|
|
|
|
|
|
|
|
let community = await createCommunity(alpha);
|
|
|
|
|
|
|
|
let post = await createPost(alpha, community.community_view.community.id);
|
|
|
|
|
|
|
|
let featuredPost = await featurePost(alpha, true, post.post_view.post);
|
|
|
|
|
|
|
|
expect(featuredPost.post_view.post.featured_community).toBe(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fetch the community, ensure that post is also fetched and marked as featured
|
|
|
|
|
|
|
|
let betaCommunity = await resolveCommunity(
|
|
|
|
|
|
|
|
beta,
|
|
|
|
|
|
|
|
community.community_view.community.actor_id,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const betaPost = await waitForPost(
|
|
|
|
|
|
|
|
beta,
|
|
|
|
|
|
|
|
post.post_view.post,
|
|
|
|
|
|
|
|
post => post?.post.featured_community === true,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test("Lock a post", async () => {
|
|
|
|
test("Lock a post", async () => {
|
|
|
|
if (!betaCommunity) {
|
|
|
|
if (!betaCommunity) {
|
|
|
|
throw "Missing beta community";
|
|
|
|
throw "Missing beta community";
|
|
|
|