-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #321 from pederjohnsen/return_skin_emoji_on_search
Return skin emoji on search
- Loading branch information
Showing
4 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/utils/emoji-index/__tests__/nimble-emoji-index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import NimbleEmojiIndex from '../nimble-emoji-index.js' | ||
import store from '../../store' | ||
|
||
import data from '../../../../data/all' | ||
|
||
const nimbleEmojiIndex = new NimbleEmojiIndex(data); | ||
|
||
function getEmojiData(skinTone) { | ||
store.update({skin: skinTone}) | ||
|
||
return nimbleEmojiIndex.search('thumbsup')[0] | ||
} | ||
|
||
test('should return emojis with skin tone 1', () => { | ||
const skinTone = 1 | ||
const emoji = getEmojiData(skinTone) | ||
expect(emoji.skin).toEqual(skinTone) | ||
}) | ||
|
||
test('should return emojis with skin tone 6', () => { | ||
const skinTone = 6 | ||
const emoji = getEmojiData(skinTone) | ||
expect(emoji.skin).toEqual(skinTone) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters