diff options
| author | Henry Jameson <me@hjkos.com> | 2019-01-17 19:16:45 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-01-17 19:16:45 +0300 |
| commit | 5251de317dcd67d123109d64a0c39037267e1705 (patch) | |
| tree | 9b780b8239063558a46430a4735076af963a021e /test/unit/specs/modules/users.spec.js | |
| parent | d7bd294666cba08b6f6a8d447fbdf4cd59e66b2b (diff) | |
| parent | 387bf794ffbfb202fc426a578f174e7d6e3681d6 (diff) | |
Merge branch 'switch-to-string-ids' into favorites
with some changes/merge conflicts resolution
* switch-to-string-ids:
fixx?????
fix notifications?
fix lint
fix tests, removed one unused function, fix real problem that tests helped to surface
added some more explicit to string conversion since BE seem to be sending numbers and it could cause an issue.
Remove all explicit and implicit conversions of statusId to number, changed explicit ones so that they convert them to string
Diffstat (limited to 'test/unit/specs/modules/users.spec.js')
| -rw-r--r-- | test/unit/specs/modules/users.spec.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/unit/specs/modules/users.spec.js b/test/unit/specs/modules/users.spec.js index af60c9b3..b0f3c51e 100644 --- a/test/unit/specs/modules/users.spec.js +++ b/test/unit/specs/modules/users.spec.js @@ -6,8 +6,8 @@ describe('The users module', () => { describe('mutations', () => { it('adds new users to the set, merging in new information for old users', () => { const state = cloneDeep(defaultState) - const user = { id: 1, name: 'Guy' } - const modUser = { id: 1, name: 'Dude' } + const user = { id: '1', name: 'Guy' } + const modUser = { id: '1', name: 'Dude' } mutations.addNewUsers(state, [user]) expect(state.users).to.have.length(1) @@ -21,7 +21,7 @@ describe('The users module', () => { it('sets a mute bit on users', () => { const state = cloneDeep(defaultState) - const user = { id: 1, name: 'Guy' } + const user = { id: '1', name: 'Guy' } mutations.addNewUsers(state, [user]) mutations.setMuted(state, {user, muted: true}) @@ -38,11 +38,11 @@ describe('The users module', () => { it('returns user with matching screen_name', () => { const state = { users: [ - { screen_name: 'Guy', id: 1 } + { screen_name: 'Guy', id: '1' } ] } const name = 'Guy' - const expected = { screen_name: 'Guy', id: 1 } + const expected = { screen_name: 'Guy', id: '1' } expect(getters.userByName(state)(name)).to.eql(expected) }) }) @@ -51,11 +51,11 @@ describe('The users module', () => { it('returns user with matching id', () => { const state = { users: [ - { screen_name: 'Guy', id: 1 } + { screen_name: 'Guy', id: '1' } ] } - const id = 1 - const expected = { screen_name: 'Guy', id: 1 } + const id = '1' + const expected = { screen_name: 'Guy', id: '1' } expect(getters.userById(state)(id)).to.eql(expected) }) }) |
