emoji-mart-lazyload/spec/picker-spec.js

38 lines
872 B
JavaScript
Raw Normal View History

2017-10-07 04:02:02 +00:00
import React from 'react'
import TestUtils from 'react-dom/test-utils'
2017-11-09 06:41:57 +00:00
import Picker from '../src/components/picker'
2017-10-07 04:02:02 +00:00
const { click } = TestUtils.Simulate
const {
renderIntoDocument,
scryRenderedComponentsWithType,
findRenderedComponentWithType,
2017-10-07 04:02:02 +00:00
} = TestUtils
2017-11-09 06:41:57 +00:00
const render = (props = {}) => {
const defaultProps = {}
return renderIntoDocument(<Picker {...defaultProps} {...props} />)
}
describe('Picker', () => {
2017-10-07 04:02:02 +00:00
let subject
it('works', () => {
2017-10-07 04:02:02 +00:00
subject = render()
expect(subject).toBeDefined()
})
2017-02-17 14:47:14 +00:00
describe('categories', () => {
it('shows 10 by default', () => {
2017-10-07 04:02:02 +00:00
subject = render()
expect(subject.categories.length).toEqual(10)
})
2017-02-17 14:47:14 +00:00
it('will not show some based upon our filter', () => {
2017-10-07 04:02:02 +00:00
subject = render({ emojisToShowFilter: unified => false })
expect(subject.categories.length).toEqual(2)
})
})
})