2017-02-02 18:43:26 +00:00
|
|
|
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',
|
2017-02-02 18:43:26 +00:00
|
|
|
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';
|
2017-04-18 15:00:20 +00:00
|
|
|
expect(emojiIndex.search('apple', { emojisToShowFilter }).map((obj) => obj.id))
|
2017-02-17 14:47:14 +00:00
|
|
|
.not.toContain('pineapple');
|
|
|
|
});
|
2017-04-18 15:00:20 +00:00
|
|
|
|
|
|
|
it('can include/exclude categories', () => {
|
|
|
|
expect(emojiIndex.search('flag', { include: ['people'] }))
|
|
|
|
.toEqual([])
|
|
|
|
})
|
2017-02-02 18:43:26 +00:00
|
|
|
});
|
|
|
|
});
|