mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-16 18:15:17 +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,
|
"additionalProperties": false,
|
||||||
"required": ["serverEndpoint", "serverPort", "username", "password", "senderMail", "openMetadataUrl"]
|
"required": ["serverEndpoint", "serverPort", "senderMail", "openMetadataUrl"]
|
||||||
}
|
}
|
||||||
@ -49,16 +49,10 @@ function EmailConfigForm({
|
|||||||
validateMessages={VALIDATION_MESSAGES}
|
validateMessages={VALIDATION_MESSAGES}
|
||||||
onFinish={onSubmit}
|
onFinish={onSubmit}
|
||||||
onFocus={onFocus}>
|
onFocus={onFocus}>
|
||||||
<Item
|
<Item label={t('label.username')} name="username">
|
||||||
label={t('label.username')}
|
|
||||||
name="username"
|
|
||||||
rules={[{ required: true }]}>
|
|
||||||
<Input data-testid="username-input" id="root/username" />
|
<Input data-testid="username-input" id="root/username" />
|
||||||
</Item>
|
</Item>
|
||||||
<Item
|
<Item label={t('label.password')} name="password">
|
||||||
label={t('label.password')}
|
|
||||||
name="password"
|
|
||||||
rules={[{ required: true }]}>
|
|
||||||
<Input
|
<Input
|
||||||
data-testid="password-input"
|
data-testid="password-input"
|
||||||
id="root/password"
|
id="root/password"
|
||||||
|
|||||||
@ -144,4 +144,27 @@ describe('Email Config Form Component', () => {
|
|||||||
|
|
||||||
expect(mockOnSubmit).not.toHaveBeenCalled();
|
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