fix after merge

This commit is contained in:
phiresky 2023-09-21 12:01:22 +00:00
parent 5941dc2924
commit 31f3677270
3 changed files with 11 additions and 16 deletions

View file

@ -504,8 +504,7 @@ test("A and G subscribe to B (center) A posts, G mentions B, it gets announced t
expect(alphaPost.post_view.community.local).toBe(true);
// Make sure gamma sees it
let gammaPost = (await resolvePost(gamma, alphaPost.post_view.post, false))!
.post;
let gammaPost = (await resolvePost(gamma, alphaPost.post_view.post))!.post;
if (!gammaPost) {
throw "Missing gamma post";
@ -670,8 +669,8 @@ test("Fetch in_reply_tos: A is unsubbed from B, B makes a post, and some embedde
expect(updateRes.comment_view.comment.content).toBe(updatedCommentContent);
// Get the post from alpha
let alphaPostB = (await resolvePost(alpha, postOnBetaRes.post_view.post))
.post;
let alphaPostB = await waitForPost(alpha, postOnBetaRes.post_view.post);
if (!alphaPostB) {
throw "Missing alpha post B";
}

View file

@ -240,7 +240,7 @@ test("Admin actions in remote community are not federated to origin", async () =
expect(banRes.banned).toBe(true);
// ban doesnt federate to community's origin instance alpha
let alphaPost = (await resolvePost(alpha, gammaPost.post, false)).post;
let alphaPost = (await resolvePost(alpha, gammaPost.post)).post;
expect(alphaPost?.creator_banned_from_community).toBe(false);
// and neither to gamma
@ -352,8 +352,7 @@ test("User blocks instance, communities are hidden", async () => {
expect(postRes.post_view.post.id).toBeDefined();
// fetch post to alpha
let alphaPost = (await resolvePost(alpha, postRes.post_view.post, false))
.post!;
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post!;
expect(alphaPost.post).toBeDefined();
// post should be included in listing

View file

@ -192,8 +192,7 @@ test("Sticky a post", async () => {
expect(betaPost2?.post.featured_community).toBe(false);
// Make sure that gamma cannot sticky the post on beta
let gammaPost = (await resolvePost(gamma, postRes.post_view.post, false))
.post;
let gammaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
if (!gammaPost) {
throw "Missing gamma post";
}
@ -300,8 +299,7 @@ test("Remove a post from admin and community on different instance", async () =>
}
let postRes = await createPost(gamma, gammaCommunity.id);
let alphaPost = (await resolvePost(alpha, postRes.post_view.post, false))
.post;
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post;
if (!alphaPost) {
throw "Missing alpha post";
}
@ -310,7 +308,7 @@ test("Remove a post from admin and community on different instance", async () =>
expect(removedPost.post_view.post.name).toBe(postRes.post_view.post.name);
// Make sure lemmy beta sees post is NOT removed
let betaPost = (await resolvePost(beta, postRes.post_view.post, false)).post;
let betaPost = (await resolvePost(beta, postRes.post_view.post)).post;
if (!betaPost) {
throw "Missing beta post";
}
@ -504,7 +502,7 @@ 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, false)).post;
let betaPost = (await resolvePost(gamma, postRes.post_view.post)).post;
expect(betaPost?.post.name).toBeDefined();
});
@ -517,8 +515,7 @@ test("Report a post", async () => {
let postRes = await createPost(beta, betaCommunity.community.id);
expect(postRes.post_view.post).toBeDefined();
let alphaPost = (await resolvePost(alpha, postRes.post_view.post, false))
.post;
let alphaPost = (await resolvePost(alpha, postRes.post_view.post)).post;
if (!alphaPost) {
throw "Missing alpha post";
}
@ -563,7 +560,7 @@ test("Sanitize HTML", async () => {
"<script>alert('xss');</script> hello &"'",
);
let alphaPost = (await resolvePost(alpha, post.post_view.post, false)).post;
let alphaPost = (await resolvePost(alpha, post.post_view.post)).post;
// second escaping over federation, avoid double escape of &
expect(alphaPost?.post.body).toBe(
"<script>alert('xss');</script> hello &"'",