mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-24 15:46:10 +08:00
46c200896f
* cherry-pick * remove useless files * remove useless files * Group ts * update interface * ReactElement
21 lines
719 B
JavaScript
21 lines
719 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import AutoComplete from '..';
|
|
|
|
describe('AutoComplete with Custom Input Element Render', () => {
|
|
it('AutoComplete with custom Input render perfectly', () => {
|
|
const wrapper = mount(
|
|
<AutoComplete dataSource={['12345', '23456', '34567']}>
|
|
<textarea />
|
|
</AutoComplete>
|
|
);
|
|
|
|
expect(wrapper.find('textarea').length).toBe(1);
|
|
wrapper.find('textarea').simulate('change', { target: { value: '123' } });
|
|
const dropdownWrapper = mount(wrapper.find('Trigger').node.getComponent());
|
|
|
|
expect(dropdownWrapper.find('MenuItem').length).toBe(1);
|
|
expect(dropdownWrapper.find('MenuItem').props().value).toBe('12345');
|
|
});
|
|
});
|