feat: keep username suggestion for embedded experience (#950)
* feat: keep username suggestion for embedded experience
This commit is contained in:
@@ -412,10 +412,19 @@ const RegistrationPage = (props) => {
|
||||
};
|
||||
|
||||
const handleOnBlur = (event) => {
|
||||
const { name, value } = event.target;
|
||||
if (registrationEmbedded) {
|
||||
if (name === 'name') {
|
||||
validateInput(
|
||||
name,
|
||||
value,
|
||||
{ name: formFields.name, username: formFields.username, form_field_key: name },
|
||||
!validationApiRateLimited,
|
||||
false,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const { name, value } = event.target;
|
||||
const payload = {
|
||||
name: formFields.name,
|
||||
email: formFields.email,
|
||||
|
||||
@@ -252,7 +252,7 @@ describe('RegistrationPage', () => {
|
||||
|
||||
it('should not run validations on blur event when embedded variant is rendered', () => {
|
||||
delete window.location;
|
||||
window.location = { href: getConfig().BASE_URL.concat(REGISTER_PAGE), search: '?variant=embedded&host=http://localhost/host-website' };
|
||||
window.location = { href: getConfig().BASE_URL.concat(REGISTER_PAGE), search: '?host=http://localhost/host-website' };
|
||||
const registrationPage = mount(reduxWrapper(<IntlRegistrationPage {...props} />));
|
||||
|
||||
registrationPage.find('input#username').simulate('blur', { target: { value: '', name: 'username' } });
|
||||
@@ -883,7 +883,7 @@ describe('RegistrationPage', () => {
|
||||
window.parent.postMessage = jest.fn();
|
||||
|
||||
delete window.location;
|
||||
window.location = { href: getConfig().BASE_URL.concat(AUTHN_PROGRESSIVE_PROFILING), search: '?variant=embedded&host=http://localhost/host-website' };
|
||||
window.location = { href: getConfig().BASE_URL.concat(AUTHN_PROGRESSIVE_PROFILING), search: '?host=http://localhost/host-website' };
|
||||
|
||||
store = mockStore({
|
||||
...initialState,
|
||||
|
||||
Reference in New Issue
Block a user