You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import React from 'react';
|
|
|
|
import { mount } from 'enzyme';
|
|
|
|
import Tree from '../index';
|
|
|
|
|
|
|
|
const { TreeNode } = Tree;
|
|
|
|
|
|
|
|
describe('Tree', () => {
|
|
|
|
it('icon and switcherIcon of Tree with showLine should render correctly', () => {
|
|
|
|
const wrapper = mount(
|
|
|
|
<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" />
|
|
|
|
</TreeNode>
|
|
|
|
</Tree>,
|
|
|
|
);
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|