diff options
| author | shpuld <shp@cock.li> | 2019-01-30 20:49:24 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-30 20:49:24 +0200 |
| commit | c7cffbb6c70bbb21cf787d96e82e0261427b9234 (patch) | |
| tree | a517e4942725286b173b685cbe87bc6c7878b66e /test/unit/specs/modules | |
| parent | 51024a2c8af9d88b07c050b7502fa62843aa4ba2 (diff) | |
| parent | b1facdf7ad54436c2afde7c28c917cda87a5b7e3 (diff) | |
Merge branch 'develop' into feat/media-modal
Diffstat (limited to 'test/unit/specs/modules')
| -rw-r--r-- | test/unit/specs/modules/statuses.spec.js | 9 | ||||
| -rw-r--r-- | test/unit/specs/modules/users.spec.js | 11 |
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', () => { |
