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:
Evan Charlton 2020-04-14 10:48:23 +02:00 committed by GitHub
parent 1855fef437
commit 58c6900175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 11 deletions

View File

@ -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`?',
);
}

View File

@ -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();
});

View File

@ -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();
});

View File

@ -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`?',
);
}

View File

@ -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`?',
);
}

View File

@ -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();
});

View File

@ -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`?',
);
},
},