diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-17 13:32:56 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-17 13:32:56 +0200 |
| commit | 30c0cafff168fd5e73b831d96f0539427cb25a4d (patch) | |
| tree | 6a57297f26781170e644551332042319e8a8b4b7 /test/unit/specs/modules/users.spec.js | |
| parent | 4efcda1b4137fa14659a586d4d8559dcdd0f479b (diff) | |
| parent | 9364964b017154f61072ffa70b08f2ed0c7dcaeb (diff) | |
Merge remote-tracking branch 'upstream/develop' into mastoapi/emojis
* upstream/develop: (34 commits)
after store: fix setting postFormats field
fix user-card avatar falling into permament failed state
fix flake id users not fetching correctly
fix console error
afterStoreSetup: Move log in and theme load to afterStoreSetup.
afterStoreSetup: Handle 404 cases.
afterStoreSetup: Emoji and nodeinfo refactor.
afterStoreSetup: refactor TOS and panel fetching, handle 404s.
afterStoreSetup: refactor.
Load persistedStated with async/await.
whoops
レインせんぱいにサンキュー
fix embedded relationship card parsing
actually use embedded relationship if it's present
instead of filtering nulls, let's just not have them in the first place
#434 - fix plain text issue
Add floating post-status button on mobile
Update user settings icon to pencil
I18n: Update Czech translation
user_card.vue: Copy over .status-content img styling
...
Diffstat (limited to 'test/unit/specs/modules/users.spec.js')
| -rw-r--r-- | test/unit/specs/modules/users.spec.js | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/test/unit/specs/modules/users.spec.js b/test/unit/specs/modules/users.spec.js index 4d49ee24..c8bc0ae7 100644 --- a/test/unit/specs/modules/users.spec.js +++ b/test/unit/specs/modules/users.spec.js @@ -34,40 +34,31 @@ describe('The users module', () => { }) }) - describe('getUserByName', () => { + describe('findUser', () => { it('returns user with matching screen_name', () => { + const user = { screen_name: 'Guy', id: '1' } const state = { - users: [ - { screen_name: 'Guy', id: '1' } - ] + usersObject: { + 1: user, + guy: user + } } const name = 'Guy' const expected = { screen_name: 'Guy', id: '1' } - expect(getters.userByName(state)(name)).to.eql(expected) + expect(getters.findUser(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', () => { it('returns user with matching id', () => { + const user = { screen_name: 'Guy', id: '1' } const state = { - users: [ - { screen_name: 'Guy', id: '1' } - ] + usersObject: { + 1: user, + guy: user + } } const id = '1' const expected = { screen_name: 'Guy', id: '1' } - expect(getters.userById(state)(id)).to.eql(expected) + expect(getters.findUser(state)(id)).to.eql(expected) }) }) }) |
