X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fserver%2Femail.ts;h=4be013c84e9f3f170d7be2090c36c081618822af;hb=40e87e9ecc54e3513fb586928330a7855eb192c6;hp=068e820c8e5c44913c8e3d0f827f80fad21f4083;hpb=ba75d268596bc7b289bacf1cc4cb53493d6ad444;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/server/email.ts b/server/tests/api/server/email.ts index 068e820c8..4be013c84 100644 --- a/server/tests/api/server/email.ts +++ b/server/tests/api/server/email.ts @@ -5,6 +5,7 @@ import 'mocha' import { askResetPassword, createUser, reportVideoAbuse, resetPassword, runServer, uploadVideo, userLogin, wait } from '../../utils' import { flushTests, killallServers, ServerInfo, setAccessTokensToServers } from '../../utils/index' import { mockSmtpServer } from '../../utils/miscs/email' +import { waitJobs } from '../../utils/server/jobs' const expect = chai.expect @@ -32,8 +33,6 @@ describe('Test emails', function () { } } server = await runServer(1, overrideConfig) - - await wait(5000) await setAccessTokensToServers([ server ]) { @@ -57,7 +56,7 @@ describe('Test emails', function () { await askResetPassword(server.url, 'user_1@example.com') - await wait(3000) + await waitJobs(server) expect(emails).to.have.lengthOf(1) const email = emails[0] @@ -101,7 +100,7 @@ describe('Test emails', function () { const reason = 'my super bad reason' await reportVideoAbuse(server.url, server.accessToken, videoUUID, reason) - await wait(3000) + await waitJobs(server) expect(emails).to.have.lengthOf(2) const email = emails[1] @@ -115,10 +114,5 @@ describe('Test emails', function () { after(async function () { killallServers([ server ]) - - // Keep the logs if the test failed - if (this['ok']) { - await flushTests() - } }) })