diff --git a/test/user.js b/test/user.js index d1893cf788..372d334bf6 100644 --- a/test/user.js +++ b/test/user.js @@ -1459,7 +1459,7 @@ describe('User', () => { }); }); - describe('Digest.getSubscribers', (done) => { + describe('Digest.getSubscribers', () => { const uidIndex = {}; before((done) => { @@ -1561,8 +1561,11 @@ describe('User', () => { }); it('should send digests', (done) => { + const oldValue = meta.config.includeUnverifiedEmails; + meta.config.includeUnverifiedEmails = true; User.digest.execute({ interval: 'day' }, (err) => { assert.ifError(err); + meta.config.includeUnverifiedEmails = oldValue; done(); }); }); @@ -1574,6 +1577,12 @@ describe('User', () => { }); }); + it('should get delivery times', async () => { + const data = await User.digest.getDeliveryTimes(0, -1); + const users = data.users.filter(u => u.username === 'digestuser'); + assert.strictEqual(users[0].setting, 'day'); + }); + describe('unsubscribe via POST', () => { it('should unsubscribe from digest if one-click unsubscribe is POSTed', (done) => { const token = jwt.sign({