This commit is contained in:
Shpuld Shpuldson 2020-11-02 09:42:09 +02:00
parent 5e8db7ed93
commit 757706425a

View file

@ -47,10 +47,10 @@ describe('chatService', () => {
chatService.resetNewMessageCount(chat) chatService.resetNewMessageCount(chat)
expect(chat.newMessageCount).to.eql(0) expect(chat.newMessageCount).to.eql(0)
expect(chat.lastSeenMessageId).to.eql(message2.id)
const createdAt = new Date() // Add message with higher id
createdAt.setSeconds(createdAt.getSeconds() + 10) chatService.add(chat, { messages: [ message3 ] })
chatService.add(chat, { messages: [ { message3, created_at: createdAt } ] })
expect(chat.newMessageCount).to.eql(1) expect(chat.newMessageCount).to.eql(1)
}) })
}) })