emoji-mart-lazyload/src/utils/emoji-indexSpec.js

24 lines
669 B
JavaScript
Raw Normal View History

import emojiIndex from './emoji-index';
describe('#emojiIndex', () => {
describe('search', function() {
it('should work', () => {
expect(emojiIndex.search('pineapple')).toEqual([{
id: 'pineapple',
name: 'Pineapple',
colons: ':pineapple:',
emoticons: [ ],
2017-04-04 15:54:14 +00:00
unified: '1f34d',
skin: null,
native: '🍍'
}]);
});
2017-02-17 14:47:14 +00:00
it('should filter only emojis we care about, exclude pineapple', () => {
let emojisToShowFilter = (unified) => unified !== '1F34D';
expect(emojiIndex.search('apple', emojisToShowFilter).map((obj) => obj.id))
.not.toContain('pineapple');
});
});
});