import React from 'react';
import { mount } from 'enzyme';
import TreeSelect, { TreeNode } from '..';
import focusTest from '../../../tests/shared/focusTest';
import mountTest from '../../../tests/shared/mountTest';
describe('TreeSelect', () => {
focusTest(TreeSelect);
mountTest(TreeSelect);
describe('showSearch', () => {
it('keep default logic', () => {
const single = mount();
expect(single.find('.ant-select-search__field').length).toBeFalsy();
const multiple = mount();
expect(multiple.find('.ant-select-search__field').length).toBeTruthy();
});
});
describe('TreeSelect Custom Icons', () => {
it('should support customized icons', () => {
const wrapper = mount(
clear}
removeIcon={remove}
value={['leaf1', 'leaf2']}
placeholder="Please select"
multiple
allowClear
treeDefaultExpandAll
>
,
);
expect(wrapper.render()).toMatchSnapshot();
});
});
});