2019-12-05 17:48:47 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { mount } from 'enzyme';
|
|
|
|
import Tree from '../index';
|
|
|
|
|
|
|
|
const { TreeNode } = Tree;
|
|
|
|
|
|
|
|
describe('Tree', () => {
|
2019-12-11 17:43:12 +08:00
|
|
|
it('icon and switcherIcon of Tree with showLine should render correctly', () => {
|
2019-12-05 17:48:47 +08:00
|
|
|
const wrapper = mount(
|
2019-12-11 17:43:12 +08:00
|
|
|
<Tree showLine showIcon>
|
|
|
|
<TreeNode icon="icon" switcherIcon="switcherIcon" key="0-0">
|
|
|
|
<TreeNode icon="icon" switcherIcon="switcherIcon" key="0-0-0" />
|
|
|
|
<TreeNode switcherIcon="switcherIcon" key="0-0-1" />
|
|
|
|
<TreeNode icon="icon" key="0-0-2" />
|
|
|
|
<TreeNode key="0-0-3" />
|
|
|
|
</TreeNode>
|
|
|
|
<TreeNode switcherIcon="switcherIcon" key="0-1">
|
|
|
|
<TreeNode icon="icon" switcherIcon="switcherIcon" key="0-0-0" />
|
|
|
|
<TreeNode switcherIcon="switcherIcon" key="0-0-1" />
|
|
|
|
<TreeNode icon="icon" key="0-0-2" />
|
|
|
|
<TreeNode key="0-0-3" />
|
|
|
|
</TreeNode>
|
|
|
|
<TreeNode key="0-2">
|
|
|
|
<TreeNode icon="icon" switcherIcon="switcherIcon" key="0-0-0" />
|
|
|
|
<TreeNode switcherIcon="switcherIcon" key="0-0-1" />
|
|
|
|
<TreeNode icon="icon" key="0-0-2" />
|
|
|
|
<TreeNode key="0-0-3" />
|
2019-12-05 17:48:47 +08:00
|
|
|
</TreeNode>
|
|
|
|
</Tree>,
|
|
|
|
);
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|