From 757706425a1c865a0e64e9c530b3aa1e7d9e2494 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Mon, 2 Nov 2020 09:42:09 +0200 Subject: [PATCH] fix test --- test/unit/specs/services/chat_service/chat_service.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/specs/services/chat_service/chat_service.spec.js b/test/unit/specs/services/chat_service/chat_service.spec.js index 15e64bb5..0251cae7 100644 --- a/test/unit/specs/services/chat_service/chat_service.spec.js +++ b/test/unit/specs/services/chat_service/chat_service.spec.js @@ -47,10 +47,10 @@ describe('chatService', () => { chatService.resetNewMessageCount(chat) expect(chat.newMessageCount).to.eql(0) + expect(chat.lastSeenMessageId).to.eql(message2.id) - const createdAt = new Date() - createdAt.setSeconds(createdAt.getSeconds() + 10) - chatService.add(chat, { messages: [ { message3, created_at: createdAt } ] }) + // Add message with higher id + chatService.add(chat, { messages: [ message3 ] }) expect(chat.newMessageCount).to.eql(1) }) })