mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	test: digest
This commit is contained in:
		
							
								
								
									
										11
									
								
								test/user.js
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								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({ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user