From c792f46c59147b6dbe64b620e117c2bf3416edf1 Mon Sep 17 00:00:00 2001 From: phiresky Date: Wed, 20 Sep 2023 11:38:12 +0000 Subject: [PATCH] more wait for --- api_tests/src/comment.spec.ts | 7 ++++--- api_tests/src/post.spec.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api_tests/src/comment.spec.ts b/api_tests/src/comment.spec.ts index 24822d1d1..2afbc9fc7 100644 --- a/api_tests/src/comment.spec.ts +++ b/api_tests/src/comment.spec.ts @@ -34,6 +34,7 @@ import { getUnreadCount, waitUntil, delay, + waitForPost, } from "./shared"; import { CommentView } from "lemmy-js-client/dist/types/CommentView"; import { CommunityView } from "lemmy-js-client"; @@ -441,7 +442,7 @@ test("Mention beta from alpha", async () => { expect(mentionRes.comment_view.counts.score).toBe(1); // get beta's localized copy of the alpha post - let betaPost = (await resolvePost(beta, postOnAlphaRes.post_view.post)).post; + let betaPost = await waitForPost(beta, postOnAlphaRes.post_view.post); if (!betaPost) { throw "unable to locate post on beta"; } @@ -578,13 +579,13 @@ test("Check that activity from another instance is sent to third instance", asyn expect(betaPost.post_view.community.local).toBe(true); // Make sure gamma and alpha see it - let gammaPost = (await resolvePost(gamma, betaPost.post_view.post)).post; + let gammaPost = await waitForPost(gamma, betaPost.post_view.post); if (!gammaPost) { throw "Missing gamma post"; } expect(gammaPost.post).toBeDefined(); - let alphaPost = (await resolvePost(alpha, betaPost.post_view.post)).post; + let alphaPost = await waitForPost(alpha, betaPost.post_view.post); if (!alphaPost) { throw "Missing alpha post"; } diff --git a/api_tests/src/post.spec.ts b/api_tests/src/post.spec.ts index 3b0e24129..602aba8cf 100644 --- a/api_tests/src/post.spec.ts +++ b/api_tests/src/post.spec.ts @@ -167,7 +167,7 @@ test("Sticky a post", async () => { } let postRes = await createPost(alpha, betaCommunity.community.id); - let betaPost1 = (await resolvePost(beta, postRes.post_view.post, false)).post; + let betaPost1 = await waitForPost(beta, postRes.post_view.post); if (!betaPost1) { throw "Missing beta post1"; }