mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
test: refactor code (#22436)
This commit is contained in:
parent
296072a720
commit
f6722eb28b
@ -503,6 +503,7 @@ describe('Cascader', () => {
|
||||
});
|
||||
expect(wrapper.find('input').prop('placeholder')).toBe(customPlaceholder);
|
||||
});
|
||||
|
||||
it('popup correctly with defaultValue RTL', () => {
|
||||
const wrapper = mount(
|
||||
<ConfigProvider direction="rtl">
|
||||
@ -523,6 +524,7 @@ describe('Cascader', () => {
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('can be selected in RTL direction', () => {
|
||||
const options2 = [
|
||||
{
|
||||
|
@ -522,10 +522,8 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
const names: FilledFieldNamesType = getFilledFieldNames(this.props);
|
||||
if (options && options.length > 0) {
|
||||
if (state.inputValue) {
|
||||
options = this.generateFilteredOptions(prefixCls, renderEmpty);
|
||||
if (isEqual(options, this.cachedOptions)) {
|
||||
options = this.cachedOptions;
|
||||
}
|
||||
const filteredOptions = this.generateFilteredOptions(prefixCls, renderEmpty);
|
||||
options = isEqual(filteredOptions, this.cachedOptions) ? this.cachedOptions : filteredOptions;
|
||||
}
|
||||
} else {
|
||||
options = [
|
||||
|
Loading…
Reference in New Issue
Block a user