Created
July 18, 2018 16:31
-
-
Save aeneasr/9f6090355da09c7158e6df72de0c8d9f to your computer and use it in GitHub Desktop.
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
import React from 'react' | |
import Enzyme from 'enzyme' | |
import { mount } from 'enzyme' | |
import Adapter from 'enzyme-adapter-react-16' | |
import DropDown from './index' | |
Enzyme.configure({ adapter: new Adapter() }) | |
describe('DropDown input', () => { | |
const config = [{ title: 'one', value: '1' }, { title: 'two', value: '2' }, { title: 'three', value: '3' }] | |
it('should render', () => { | |
const wrapper = mount( | |
<div id="root"> | |
<DropDown config={config} /> | |
</div> | |
) | |
wrapper.find('div[role*="button"]').first().simulate('click') | |
wrapper.update() | |
config.forEach(({ title }) => { | |
expect(wrapper.html().indexOf(title)).toBeGreaterThan(-1) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment