Kaynağa Gözat

Add test for marking notifications as unread

sbkwgh 8 yıl önce
ebeveyn
işleme
7e9d8b3fa8
1 değiştirilmiş dosya ile 2 ekleme ve 10 silme
  1. 2 10
      test/notification.js

+ 2 - 10
test/notification.js

@@ -159,15 +159,7 @@ describe('Notifications', () => {
 		})
 
 		it('should set unreadCount to 0', async () => {
-			await user
-				.post('/api/v1/post')
-				.set('content-type', 'application/json')
-				.send({ threadId: 1, content: 'POST 1', mentions: ['adminaccount'] })
-
-			await user
-				.post('/api/v1/post')
-				.set('content-type', 'application/json')
-				.send({ threadId: 1, content: 'POST 2', mentions: ['adminaccount'] })
+			await admin.put('/api/v1/notification')
 
 			let res = await admin.get('/api/v1/notification')
 
@@ -178,7 +170,7 @@ describe('Notifications', () => {
 			res.body.Notifications.should.contain.something.that.has.deep.property('interacted', false)
 			res.body.Notifications.should.contain.something.that.has.deep.property('User.username', 'useraccount')
 			res.body.Notifications.should.contain.something.that.has.deep.property('Post.content', '<p>POST 1</p>\n')
-			res.body.should.have.property('unreadCount', 2)
+			res.body.should.have.property('unreadCount', 0)
 		})
 	})