aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/components/user_profile.spec.js3
-rw-r--r--test/unit/specs/services/chat_service/chat_service.spec.js9
-rw-r--r--test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js6
3 files changed, 13 insertions, 5 deletions
diff --git a/test/unit/specs/components/user_profile.spec.js b/test/unit/specs/components/user_profile.spec.js
index dcf066f9..80092b41 100644
--- a/test/unit/specs/components/user_profile.spec.js
+++ b/test/unit/specs/components/user_profile.spec.js
@@ -8,8 +8,7 @@ const localVue = createLocalVue()
localVue.use(Vuex)
const mutations = {
- clearTimeline: () => {},
- setError: () => {}
+ clearTimeline: () => {}
}
const actions = {
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 2eb89a2d..0251cae7 100644
--- a/test/unit/specs/services/chat_service/chat_service.spec.js
+++ b/test/unit/specs/services/chat_service/chat_service.spec.js
@@ -2,17 +2,20 @@ import chatService from '../../../../../src/services/chat_service/chat_service.j
const message1 = {
id: '9wLkdcmQXD21Oy8lEX',
+ idempotency_key: '1',
created_at: (new Date('2020-06-22T18:45:53.000Z'))
}
const message2 = {
id: '9wLkdp6ihaOVdNj8Wu',
+ idempotency_key: '2',
account_id: '9vmRb29zLQReckr5ay',
created_at: (new Date('2020-06-22T18:45:56.000Z'))
}
const message3 = {
id: '9wLke9zL4Dy4OZR2RM',
+ idempotency_key: '3',
account_id: '9vmRb29zLQReckr5ay',
created_at: (new Date('2020-07-22T18:45:59.000Z'))
}
@@ -44,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)
})
})
diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
index e1f7a958..a3f49b2c 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -311,6 +311,12 @@ describe('API Entities normalizer', () => {
expect(parseUser(user)).to.have.property('hide_followers_count', false)
expect(parseUser(user)).to.have.property('hide_follows_count', true)
})
+
+ it('converts IDN to unicode and marks it as internatonal', () => {
+ const user = makeMockUserMasto({ acct: 'lain@xn--lin-6cd.com' })
+
+ expect(parseUser(user)).to.have.property('screen_name').that.equal('lain@🌏lаin.com')
+ })
})
// We currently use QvitterAPI notifications only, and especially due to MastoAPI lacking is_seen, support for MastoAPI