mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
fix: AutoComplete custom input element className (#29725)
* test: add test case * upgrade select version * fix test case * fix snapshot
This commit is contained in:
parent
a4a009cb62
commit
fbe02ceed3
@ -153,7 +153,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
|
||||
aria-haspopup="listbox"
|
||||
aria-owns="undefined_list"
|
||||
autocomplete="off"
|
||||
class="ant-input ant-select-selection-search-input"
|
||||
class="ant-input ant-select-selection-search-input custom"
|
||||
placeholder="input here"
|
||||
role="combobox"
|
||||
style="height:50px"
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import AutoComplete from '..';
|
||||
import Input from '../../input';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
|
||||
@ -78,4 +79,13 @@ describe('AutoComplete', () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn.mockRestore();
|
||||
});
|
||||
|
||||
it('should not override custom input className', () => {
|
||||
const wrapper = mount(
|
||||
<AutoComplete>
|
||||
<Input className="custom" />
|
||||
</AutoComplete>,
|
||||
);
|
||||
expect(wrapper.find('input').hasClass('custom')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
@ -136,7 +136,7 @@
|
||||
"rc-progress": "~3.1.0",
|
||||
"rc-rate": "~2.9.0",
|
||||
"rc-resize-observer": "^1.0.0",
|
||||
"rc-select": "~12.1.0",
|
||||
"rc-select": "~12.1.6",
|
||||
"rc-slider": "~9.7.1",
|
||||
"rc-steps": "~4.1.0",
|
||||
"rc-switch": "~3.2.0",
|
||||
|
Loading…
Reference in New Issue
Block a user