test: digest

isekai-main
Barış Soner Uşaklı 2 years ago
parent e0149462b3
commit 61563b01df

@ -1490,21 +1490,19 @@ describe('User', () => {
], done); ], done);
}); });
it('should send digests', (done) => { it('should send digests', async () => {
const oldValue = meta.config.includeUnverifiedEmails; const oldValue = meta.config.includeUnverifiedEmails;
meta.config.includeUnverifiedEmails = true; meta.config.includeUnverifiedEmails = true;
User.digest.execute({ interval: 'day' }, (err) => { const uid = await User.create({ username: 'digest' });
assert.ifError(err); await User.digest.execute({
meta.config.includeUnverifiedEmails = oldValue; interval: 'day',
done(); subscribers: [uid],
}); });
meta.config.includeUnverifiedEmails = oldValue;
}); });
it('should not send digests', (done) => { it('should not send digests', async () => {
User.digest.execute({ interval: 'month' }, (err) => { await User.digest.execute({ interval: 'month' });
assert.ifError(err);
done();
});
}); });
it('should get delivery times', async () => { it('should get delivery times', async () => {

Loading…
Cancel
Save