aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/services/chat_service/chat_service.spec.js
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2022-08-05 11:53:44 +0200
committermarcin mikołajczak <git@mkljczk.pl>2022-08-05 11:53:44 +0200
commit6649baaac94348bbf09015eeb2c8eeea714096db (patch)
tree6793738e657b087b5f0aa556dc7a82a79e2ccb1f /test/unit/specs/services/chat_service/chat_service.spec.js
parent79d02bddbe2b77574844b8ade7a09043c31b1c6b (diff)
parent610720f164dc9fcf36f9df33bddec5ac9c654e1e (diff)
Merge remote-tracking branch 'pleroma/develop' into birthdays
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test/unit/specs/services/chat_service/chat_service.spec.js')
-rw-r--r--test/unit/specs/services/chat_service/chat_service.spec.js24
1 files changed, 12 insertions, 12 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 fbbca436..a42269b4 100644
--- a/test/unit/specs/services/chat_service/chat_service.spec.js
+++ b/test/unit/specs/services/chat_service/chat_service.spec.js
@@ -24,23 +24,23 @@ describe('chatService', () => {
describe('.add', () => {
it("Doesn't add duplicates", () => {
const chat = chatService.empty()
- chatService.add(chat, { messages: [ message1 ] })
- chatService.add(chat, { messages: [ message1 ] })
+ chatService.add(chat, { messages: [message1] })
+ chatService.add(chat, { messages: [message1] })
expect(chat.messages.length).to.eql(1)
- chatService.add(chat, { messages: [ message2 ] })
+ chatService.add(chat, { messages: [message2] })
expect(chat.messages.length).to.eql(2)
})
it('Updates minId and lastMessage and newMessageCount', () => {
const chat = chatService.empty()
- chatService.add(chat, { messages: [ message1 ] })
+ chatService.add(chat, { messages: [message1] })
expect(chat.maxId).to.eql(message1.id)
expect(chat.minId).to.eql(message1.id)
expect(chat.newMessageCount).to.eql(1)
- chatService.add(chat, { messages: [ message2 ] })
+ chatService.add(chat, { messages: [message2] })
expect(chat.maxId).to.eql(message2.id)
expect(chat.minId).to.eql(message1.id)
expect(chat.newMessageCount).to.eql(2)
@@ -50,7 +50,7 @@ describe('chatService', () => {
expect(chat.lastSeenMessageId).to.eql(message2.id)
// Add message with higher id
- chatService.add(chat, { messages: [ message3 ] })
+ chatService.add(chat, { messages: [message3] })
expect(chat.newMessageCount).to.eql(1)
})
})
@@ -59,9 +59,9 @@ describe('chatService', () => {
it('Updates minId and lastMessage', () => {
const chat = chatService.empty()
- chatService.add(chat, { messages: [ message1 ] })
- chatService.add(chat, { messages: [ message2 ] })
- chatService.add(chat, { messages: [ message3 ] })
+ chatService.add(chat, { messages: [message1] })
+ chatService.add(chat, { messages: [message2] })
+ chatService.add(chat, { messages: [message3] })
expect(chat.maxId).to.eql(message3.id)
expect(chat.minId).to.eql(message1.id)
@@ -80,9 +80,9 @@ describe('chatService', () => {
it('Inserts date separators', () => {
const chat = chatService.empty()
- chatService.add(chat, { messages: [ message1 ] })
- chatService.add(chat, { messages: [ message2 ] })
- chatService.add(chat, { messages: [ message3 ] })
+ chatService.add(chat, { messages: [message1] })
+ chatService.add(chat, { messages: [message2] })
+ chatService.add(chat, { messages: [message3] })
const view = chatService.getView(chat)
expect(view.map(i => i.type)).to.eql(['date', 'message', 'message', 'date', 'message'])