fix: pass correct arguments to setEmailSuggestionContext in handleSuggestionClick
The function expects two string arguments (suggestion, type) but was being called with a single object, corrupting the email suggestion state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Adolfo R. Brandes
parent
cb3ad5c53a
commit
3dbd6a76df
@@ -84,7 +84,7 @@ const EmailField = (props) => {
|
||||
handleErrorChange('email', '');
|
||||
handleChange({ target: { name: 'email', value: emailSuggestion.suggestion } });
|
||||
setEmailSuggestion({ suggestion: '', type: '' });
|
||||
setEmailSuggestionContext({ suggestion: '', type: '' });
|
||||
setEmailSuggestionContext('', '');
|
||||
};
|
||||
|
||||
const handleSuggestionClosed = () => setEmailSuggestion({ suggestion: '', type: '' });
|
||||
|
||||
@@ -182,6 +182,10 @@ describe('EmailField', () => {
|
||||
expect(props.handleChange).toHaveBeenCalledWith(
|
||||
{ target: { name: 'email', value: 'john@hotmail.com' } },
|
||||
);
|
||||
expect(mockRegisterContext.setEmailSuggestionContext).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
expect.any(String),
|
||||
);
|
||||
});
|
||||
|
||||
it('should give error for common top level domain mistakes', () => {
|
||||
|
||||
Reference in New Issue
Block a user