test: fix cascader test coverage (#33802)

This commit is contained in:
MadCcc 2022-01-21 11:49:07 +08:00 committed by GitHub
parent 5d2994ec12
commit 9cf0dca8fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -475,6 +475,12 @@ describe('Cascader', () => {
expect(onChange).toHaveBeenCalledWith(['Zhejiang', 'Hangzhou', 'West Lake'], expect.anything());
});
it('rtl should work well with placement', () => {
const wrapper = mount(<Cascader options={options} direction="rtl" />);
expect(wrapper.find('Trigger').prop('popupPlacement')).toEqual('bottomRight');
});
describe('legacy props', () => {
it('popupClassName', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});