mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-23 01:41:01 +00:00
fix wait
This commit is contained in:
parent
9e886fba4a
commit
954b3f443d
2 changed files with 11 additions and 5 deletions
|
@ -511,7 +511,7 @@ test("A and G subscribe to B (center) A posts, G mentions B, it gets announced t
|
||||||
// Make sure alpha sees it
|
// Make sure alpha sees it
|
||||||
let alphaPostComments2 = await waitUntil(
|
let alphaPostComments2 = await waitUntil(
|
||||||
() => getComments(alpha, alphaPost.post_view.post.id),
|
() => getComments(alpha, alphaPost.post_view.post.id),
|
||||||
e => !!e.comments[0],
|
e => e.comments[0]?.counts.score === 1,
|
||||||
);
|
);
|
||||||
expect(alphaPostComments2.comments[0].comment.content).toBe(commentContent);
|
expect(alphaPostComments2.comments[0].comment.content).toBe(commentContent);
|
||||||
expect(alphaPostComments2.comments[0].community.local).toBe(true);
|
expect(alphaPostComments2.comments[0].community.local).toBe(true);
|
||||||
|
|
|
@ -365,16 +365,22 @@ test("Remove a post from admin and community on same instance", async () => {
|
||||||
expect(removePostRes.post_view.post.removed).toBe(true);
|
expect(removePostRes.post_view.post.removed).toBe(true);
|
||||||
|
|
||||||
// Make sure lemmy alpha sees post is removed
|
// Make sure lemmy alpha sees post is removed
|
||||||
// let alphaPost = await getPost(alpha, postRes.post_view.post.id);
|
let alphaPost = await waitUntil(
|
||||||
// expect(alphaPost.post_view.post.removed).toBe(true); // TODO this shouldn't be commented
|
() => getPost(alpha, postRes.post_view.post.id),
|
||||||
// assertPostFederation(alphaPost.post_view, removePostRes.post_view);
|
p => p.post_view.post.removed,
|
||||||
|
);
|
||||||
|
expect(alphaPost.post_view.post.removed).toBe(true);
|
||||||
|
assertPostFederation(alphaPost.post_view, removePostRes.post_view);
|
||||||
|
|
||||||
// Undelete
|
// Undelete
|
||||||
let undeletedPost = await removePost(beta, false, betaPost.post);
|
let undeletedPost = await removePost(beta, false, betaPost.post);
|
||||||
expect(undeletedPost.post_view.post.removed).toBe(false);
|
expect(undeletedPost.post_view.post.removed).toBe(false);
|
||||||
|
|
||||||
// Make sure lemmy alpha sees post is undeleted
|
// Make sure lemmy alpha sees post is undeleted
|
||||||
let alphaPost2 = await getPost(alpha, postRes.post_view.post.id);
|
let alphaPost2 = await waitUntil(
|
||||||
|
() => getPost(alpha, postRes.post_view.post.id),
|
||||||
|
p => !p.post_view.post.removed,
|
||||||
|
);
|
||||||
expect(alphaPost2.post_view.post.removed).toBe(false);
|
expect(alphaPost2.post_view.post.removed).toBe(false);
|
||||||
assertPostFederation(alphaPost2.post_view, undeletedPost.post_view);
|
assertPostFederation(alphaPost2.post_view, undeletedPost.post_view);
|
||||||
await unfollowRemotes(alpha);
|
await unfollowRemotes(alpha);
|
||||||
|
|
Loading…
Reference in a new issue