0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Added temporary fix for random test failures in comments

refs https://ghost.slack.com/archives/C02G9E68C/p1663162175224299

This requires a better fix in the future that properly awaits the emails (not really possible at the moment) or disables sending new member emails when using loginAs
This commit is contained in:
Simon Backx 2022-09-14 17:02:13 +02:00
parent 50e00a3b4c
commit d5b332ab02

View file

@ -292,7 +292,12 @@ describe('Comments API', function () {
await membersAgent.loginAs('member@example.com');
member = await models.Member.findOne({email: 'member@example.com'}, {require: true});
await membersAgent2.loginAs('member2@example.com');
// Wait before we mock emails from newly created members
// todo: in the future we need a way to wait for DomainEvents to be fired and handled correctly
await sleep(200);
});
beforeEach(function () {
getStub = sinon.stub(settingsCache, 'get');
getStub.callsFake((key, options) => {