diff --git a/api_tests/src/comment.spec.ts b/api_tests/src/comment.spec.ts index 9011fb8f..2314205d 100644 --- a/api_tests/src/comment.spec.ts +++ b/api_tests/src/comment.spec.ts @@ -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 let alphaPostComments2 = await waitUntil( () => 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].community.local).toBe(true); diff --git a/api_tests/src/post.spec.ts b/api_tests/src/post.spec.ts index b2d07c29..89dfaa35 100644 --- a/api_tests/src/post.spec.ts +++ b/api_tests/src/post.spec.ts @@ -365,16 +365,22 @@ test("Remove a post from admin and community on same instance", async () => { 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); - // expect(alphaPost.post_view.post.removed).toBe(true); // TODO this shouldn't be commented - // assertPostFederation(alphaPost.post_view, removePostRes.post_view); + let alphaPost = await waitUntil( + () => getPost(alpha, postRes.post_view.post.id), + p => p.post_view.post.removed, + ); + expect(alphaPost.post_view.post.removed).toBe(true); + assertPostFederation(alphaPost.post_view, removePostRes.post_view); // Undelete let undeletedPost = await removePost(beta, false, betaPost.post); expect(undeletedPost.post_view.post.removed).toBe(false); // 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); assertPostFederation(alphaPost2.post_view, undeletedPost.post_view); await unfollowRemotes(alpha);