aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/specs')
-rw-r--r--test/unit/specs/modules/statuses.spec.js9
-rw-r--r--test/unit/specs/modules/users.spec.js11
2 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js
index 33628b9b..01d2ce06 100644
--- a/test/unit/specs/modules/statuses.spec.js
+++ b/test/unit/specs/modules/statuses.spec.js
@@ -240,6 +240,15 @@ describe('The Statuses module', () => {
expect(state.timelines.public.visibleStatuses[0].favorited).to.eql(true)
})
+ it('keeps userId when clearing user timeline', () => {
+ const state = cloneDeep(defaultState)
+ state.timelines.user.userId = 123
+
+ mutations.clearTimeline(state, { timeline: 'user' })
+
+ expect(state.timelines.user.userId).to.eql(123)
+ })
+
describe('notifications', () => {
it('removes a notification when the notice gets removed', () => {
const user = { id: '1' }
diff --git a/test/unit/specs/modules/users.spec.js b/test/unit/specs/modules/users.spec.js
index b0f3c51e..4d49ee24 100644
--- a/test/unit/specs/modules/users.spec.js
+++ b/test/unit/specs/modules/users.spec.js
@@ -45,6 +45,17 @@ describe('The users module', () => {
const expected = { screen_name: 'Guy', id: '1' }
expect(getters.userByName(state)(name)).to.eql(expected)
})
+
+ it('returns user with matching screen_name with different case', () => {
+ const state = {
+ users: [
+ { screen_name: 'guy', id: '1' }
+ ]
+ }
+ const name = 'Guy'
+ const expected = { screen_name: 'guy', id: '1' }
+ expect(getters.userByName(state)(name)).to.eql(expected)
+ })
})
describe('getUserById', () => {