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

29 lines
816 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))
2017-02-17 14:47:14 +00:00
.not.toContain('pineapple');
});
it('can include/exclude categories', () => {
expect(emojiIndex.search('flag', { include: ['people'] }))
.toEqual([])
})
});
});