Add tests

release
Peder Johnsen 2019-03-23 21:31:11 +00:00
parent d140dd8f04
commit ab2f6004ac
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import React from 'react'
import { getEmojiDataFromNative } from '..'
import data from '../../../data/apple'
test('will find man lifting weights with skin tone 6', () => {
const emojiData = getEmojiDataFromNative('🏋🏿‍♂️', 'apple', data)
expect(emojiData.id).toEqual('man-lifting-weights')
expect(emojiData.skin).toEqual(6)
})
test('will find woman swimming with skin tone 4', () => {
const emojiData = getEmojiDataFromNative('🏊🏽‍♀️', 'apple', data)
expect(emojiData.id).toEqual('woman-swimming')
expect(emojiData.skin).toEqual(4)
})
test('will find person in lotus positions', () => {
const emojiData = getEmojiDataFromNative('🧘', 'apple', data)
expect(emojiData.id).toEqual('person_in_lotus_position')
expect(emojiData.skin).toEqual(1)
})
test('returns null if no match', () => {
const emojiData = getEmojiDataFromNative('', 'apple', data)
expect(emojiData).toEqual(null)
})