mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
a5efa7a81a
* test: increase test case of Progress and Comment * test: add test case for Avatar * test: add test case for Dropdown * fix snapshot * fix snapshot * remove console.log * fix lint * add avatar
39 lines
966 B
JavaScript
39 lines
966 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import Dropdown from '..';
|
|
import Menu from '../../menu';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
import rtlTest from '../../../tests/shared/rtlTest';
|
|
|
|
describe('Dropdown', () => {
|
|
mountTest(() => (
|
|
<Dropdown menu={<Menu />}>
|
|
<span />
|
|
</Dropdown>
|
|
));
|
|
|
|
rtlTest(() => (
|
|
<Dropdown menu={<Menu />}>
|
|
<span />
|
|
</Dropdown>
|
|
));
|
|
|
|
it('overlay is function and has custom transitionName', () => {
|
|
const wrapper = mount(
|
|
<Dropdown overlay={() => <div>menu</div>} transitionName="move-up" visible>
|
|
<button type="button">button</button>
|
|
</Dropdown>,
|
|
);
|
|
expect(wrapper).toMatchRenderedSnapshot();
|
|
});
|
|
|
|
it('overlay is string', () => {
|
|
const wrapper = mount(
|
|
<Dropdown overlay="string" visible>
|
|
<button type="button">button</button>
|
|
</Dropdown>,
|
|
);
|
|
expect(wrapper).toMatchRenderedSnapshot();
|
|
});
|
|
});
|