Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
[MM-14278] Update unit tests for emoji actions (#2433)
Browse files Browse the repository at this point in the history
* [MM-14278] Display same recent emoji only once

* A recent change had recent emojis stored by alias, resulting in identical emoji such as 👍 or 👍 displayed twice
* This reverts that change to store by the first alias only, de-duplicating the recent history
* Additinally, `emoji.id` was undefined, using `emojiIndex` instead

* [MM-14278] Update unit tests for emoji actions
  • Loading branch information
bradjcoughlin committed Mar 11, 2019
1 parent 32fb7ce commit b397140
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion actions/emoji_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ describe('Actions.Emojis', () => {
store = await configureStore();
});

it('addRecentEmoji', async () => {
test('Emoji alias is stored in recent emojis', async () => {
store.dispatch(Actions.addRecentEmoji('grinning'));
assert.ok(getRecentEmojis(store.getState()).includes('grinning'));
});

test('First alias is stored in recent emojis even if second alias used', async () => {
store.dispatch(Actions.addRecentEmoji('cop'));
assert.ok(getRecentEmojis(store.getState()).includes('policeman'));
});

test('Invalid emoji are not stored in recents', async () => {
store.dispatch(Actions.addRecentEmoji('joramwilander'));
assert.ok(!getRecentEmojis(store.getState()).includes('joramwilander'));
});
Expand Down

0 comments on commit b397140

Please sign in to comment.