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
}
}
server = await runServer(1, overrideConfig)
-
- await wait(5000)
await setAccessTokensToServers([ server ])
{
await askResetPassword(server.url, 'user_1@example.com')
- await wait(3000)
+ await waitJobs(server)
expect(emails).to.have.lengthOf(1)
const email = emails[0]
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]
after(async function () {
killallServers([ server ])
-
- // Keep the logs if the test failed
- if (this['ok']) {
- await flushTests()
- }
})
})