mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 12:39:01 +00:00
Minor: make password and username field non required in email config form (#16133)
* Minor: make password field as non required in email config form * chore: Update email config form to make password field non-required
This commit is contained in:
parent
0769d71ee7
commit
b04837cdeb
@ -52,5 +52,5 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["serverEndpoint", "serverPort", "username", "password", "senderMail", "openMetadataUrl"]
|
||||
"required": ["serverEndpoint", "serverPort", "senderMail", "openMetadataUrl"]
|
||||
}
|
@ -49,16 +49,10 @@ function EmailConfigForm({
|
||||
validateMessages={VALIDATION_MESSAGES}
|
||||
onFinish={onSubmit}
|
||||
onFocus={onFocus}>
|
||||
<Item
|
||||
label={t('label.username')}
|
||||
name="username"
|
||||
rules={[{ required: true }]}>
|
||||
<Item label={t('label.username')} name="username">
|
||||
<Input data-testid="username-input" id="root/username" />
|
||||
</Item>
|
||||
<Item
|
||||
label={t('label.password')}
|
||||
name="password"
|
||||
rules={[{ required: true }]}>
|
||||
<Item label={t('label.password')} name="password">
|
||||
<Input
|
||||
data-testid="password-input"
|
||||
id="root/password"
|
||||
|
@ -144,4 +144,27 @@ describe('Email Config Form Component', () => {
|
||||
|
||||
expect(mockOnSubmit).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call onSubmit if password and username is not filled', async () => {
|
||||
render(
|
||||
<EmailConfigForm
|
||||
{...mockProps}
|
||||
emailConfigValues={{
|
||||
...emailConfigValues,
|
||||
password: '',
|
||||
username: '',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(screen.getByText('label.submit'));
|
||||
});
|
||||
|
||||
expect(mockOnSubmit).toHaveBeenCalledWith({
|
||||
...emailConfigValues,
|
||||
password: '',
|
||||
username: '',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user