mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
chore: Fix console warning typo (validate -> valid) (#23240)
Clean up the typos in the helpful console warning messages which get emitted if the incorrect prop is passed to certain components.
This commit is contained in:
parent
1855fef437
commit
58c6900175
@ -63,7 +63,7 @@ class Checkbox extends React.PureComponent<CheckboxProps, {}> {
|
||||
warning(
|
||||
'checked' in this.props || this.context || !('value' in this.props),
|
||||
'Checkbox',
|
||||
'`value` is not validate prop, do you mean `checked`?',
|
||||
'`value` is not a valid prop, do you mean `checked`?',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ describe('Checkbox', () => {
|
||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
mount(<Checkbox value />);
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
'Warning: [antd: Checkbox] `value` is not validate prop, do you mean `checked`?',
|
||||
'Warning: [antd: Checkbox] `value` is not a valid prop, do you mean `checked`?',
|
||||
);
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
|
@ -13,10 +13,7 @@ describe('Switch', () => {
|
||||
|
||||
it('should has click wave effect', async () => {
|
||||
const wrapper = mount(<Switch />);
|
||||
wrapper
|
||||
.find('.ant-switch')
|
||||
.getDOMNode()
|
||||
.click();
|
||||
wrapper.find('.ant-switch').getDOMNode().click();
|
||||
await new Promise(resolve => setTimeout(resolve, 0));
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
@ -27,7 +24,7 @@ describe('Switch', () => {
|
||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
mount(<Switch value />);
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
'Warning: [antd: Switch] `value` is not validate prop, do you mean `checked`?',
|
||||
'Warning: [antd: Switch] `value` is not a valid prop, do you mean `checked`?',
|
||||
);
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
|
@ -41,7 +41,7 @@ export default class Switch extends React.Component<SwitchProps, {}> {
|
||||
warning(
|
||||
'checked' in props || !('value' in props),
|
||||
'Switch',
|
||||
'`value` is not validate prop, do you mean `checked`?',
|
||||
'`value` is not a valid prop, do you mean `checked`?',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ class Upload extends React.Component<UploadProps, UploadState> {
|
||||
warning(
|
||||
'fileList' in props || !('value' in props),
|
||||
'Upload',
|
||||
'`value` is not validate prop, do you mean `fileList`?',
|
||||
'`value` is not a valid prop, do you mean `fileList`?',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ describe('Upload', () => {
|
||||
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
mount(<Upload value={[]} />);
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
'Warning: [antd: Upload] `value` is not validate prop, do you mean `fileList`?',
|
||||
'Warning: [antd: Upload] `value` is not a valid prop, do you mean `fileList`?',
|
||||
);
|
||||
errorSpy.mockRestore();
|
||||
});
|
||||
|
@ -34843,7 +34843,7 @@
|
||||
lt(
|
||||
'checked' in this.props || this.context || !('value' in this.props),
|
||||
'Checkbox',
|
||||
'`value` is not validate prop, do you mean `checked`?',
|
||||
'`value` is not a valid prop, do you mean `checked`?',
|
||||
);
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user