ant-design/components/tree-select/__tests__/index.test.js
二货机器人 4907996b97
feat: TreeSelect use virtual scroll (#19040)
* use new rc-tree-select

* support not found

* add switch icon support

* support function

* support selection motion

* show search icon if open

* clean up

* fix lint

* fix lint
2019-09-27 22:31:28 -05:00

37 lines
1.1 KiB
JavaScript

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('TreeSelect Custom Icons', () => {
it('should support customized icons', () => {
const wrapper = mount(
<TreeSelect
showSearch
clearIcon={<span>clear</span>}
removeIcon={<span>remove</span>}
value={['leaf1', 'leaf2']}
placeholder="Please select"
multiple
allowClear
treeDefaultExpandAll
>
<TreeNode value="parent 1" title="parent 1" key="0-1">
<TreeNode value="parent 1-0" title="parent 1-0" key="0-1-1">
<TreeNode value="leaf1" title="my leaf" key="random" />
<TreeNode value="leaf2" title="your leaf" key="random1" />
</TreeNode>
</TreeNode>
</TreeSelect>,
);
expect(wrapper.render()).toMatchSnapshot();
});
});
});