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';
import { sleep } from '../../../tests/utils';
describe('Dropdown', () => {
mountTest(() => (
}>
));
rtlTest(() => (
}>
));
it('overlay is function and has custom transitionName', () => {
const wrapper = mount(
,
);
expect(error).toHaveBeenCalledWith(
expect.stringContaining("[antd: Dropdown] You are using 'bottomCenter'"),
);
expect(error).toHaveBeenCalledWith(
expect.stringContaining("[antd: Dropdown] You are using 'topCenter'"),
);
});
// zombieJ: when replaced with react test lib, it may be mock fully content
it('dropdown should support auto adjust placement', () => {
const wrapper = mount(
menu} visible>
,
);
expect(wrapper.find('Trigger').prop('builtinPlacements')).toEqual(
expect.objectContaining({
bottomLeft: expect.objectContaining({
overflow: {
adjustX: 1,
adjustY: 1,
},
}),
}),
);
});
});