forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemoji_actions.test.js
30 lines (24 loc) · 1.05 KB
/
emoji_actions.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import assert from 'assert';
import {getRecentEmojis} from 'selectors/emojis';
import * as Actions from 'actions/emoji_actions.jsx';
import configureStore from 'store';
describe('Actions.Emojis', () => {
let store;
beforeEach(async () => {
store = await configureStore();
});
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'));
});
});