|
|
@ -14,6 +14,23 @@ describe('Menu', () => { |
|
|
|
jest.useRealTimers(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('If has select nested submenu item ,the menu items on the grandfather level should be highlight', () => { |
|
|
|
const wrapper = mount( |
|
|
|
<Menu defaultSelectedKeys={['1-3-2']} mode="vertical"> |
|
|
|
<SubMenu key="1" title="submenu1"> |
|
|
|
<Menu.Item key="1-1">Option 1</Menu.Item> |
|
|
|
<Menu.Item key="1-2">Option 2</Menu.Item> |
|
|
|
<SubMenu key="1-3" title="submenu1-3"> |
|
|
|
<Menu.Item key="1-3-1">Option 3</Menu.Item> |
|
|
|
<Menu.Item key="1-3-2">Option 4</Menu.Item> |
|
|
|
</SubMenu> |
|
|
|
</SubMenu> |
|
|
|
<Menu.Item key="2">menu2</Menu.Item> |
|
|
|
</Menu> |
|
|
|
); |
|
|
|
expect(wrapper.find('.ant-menu-submenu-selected').length).toBe(1); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should accept defaultOpenKeys in mode horizontal', () => { |
|
|
|
const wrapper = mount( |
|
|
|
<Menu defaultOpenKeys={['1']} mode="horizontal"> |
|
|
|