From: Dessalines Date: Sat, 12 Dec 2020 01:20:14 +0000 (-0500) Subject: Trying to fix post test again. X-Git-Url: http://these/git/%22https:/nerdica.net/%7B%60%24%7BwebArchiveUrl%7D/save/%7B%60%24%7BarchiveTodayUrl%7D/?a=commitdiff_plain;h=d594005d494553525518008e3809c3449ed4c220;p=lemmy.git Trying to fix post test again. --- diff --git a/api_tests/src/post.spec.ts b/api_tests/src/post.spec.ts index 5845d7f8..d771205b 100644 --- a/api_tests/src/post.spec.ts +++ b/api_tests/src/post.spec.ts @@ -101,7 +101,7 @@ test('Create a post in a non-existent community', async () => { test('Unlike a post', async () => { let search = await searchForBetaCommunity(alpha); let postRes = await createPost(alpha, search.communities[0].id); - await delay(); + await longDelay(); let unlike = await likePost(alpha, 0, postRes.post); expect(unlike.post.score).toBe(0); await longDelay(); @@ -113,6 +113,7 @@ test('Unlike a post', async () => { // Make sure that post is unliked on beta let searchBeta = await searchPost(beta, postRes.post); + await delay(); let betaPost = searchBeta.posts[0]; expect(betaPost).toBeDefined(); diff --git a/api_tests/src/shared.ts b/api_tests/src/shared.ts index ed4899f8..1e3c130a 100644 --- a/api_tests/src/shared.ts +++ b/api_tests/src/shared.ts @@ -613,7 +613,7 @@ export async function followBeta(api: API): Promise { } } -export function delay(millis: number = 500) { +export function delay(millis: number = 2000) { return new Promise((resolve, _reject) => { setTimeout(_ => resolve(), millis); });