diff --git a/demo-shell-ng2/app/components/login/login-demo.component.ts b/demo-shell-ng2/app/components/login/login-demo.component.ts index 2014686652..380f81b946 100644 --- a/demo-shell-ng2/app/components/login/login-demo.component.ts +++ b/demo-shell-ng2/app/components/login/login-demo.component.ts @@ -42,7 +42,7 @@ export class LoginDemoComponent implements OnInit { private storage: StorageService, private logService: LogService) { this.customValidation = { - username: ['', Validators.compose([Validators.required, Validators.minLength(4)])], + username: ['', Validators.compose([Validators.required, Validators.minLength(2)])], password: ['', Validators.required] }; } diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts index a30a2b863c..6d2b7682c9 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.spec.ts @@ -98,8 +98,8 @@ describe('AlfrescoLogin', () => { expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN'); }); - it('should render validation min-length error when the username is lower than 4 characters', () => { - usernameInput.value = '123'; + it('should render validation min-length error when the username is lower than 2 characters', () => { + usernameInput.value = '1'; usernameInput.dispatchEvent(new Event('input')); fixture.detectChanges(); diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts index 407dcdbe3c..17095592ce 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts @@ -262,7 +262,7 @@ export class AlfrescoLoginComponent implements OnInit { private initFormFieldsDefault() { this.form = this._fb.group({ - username: ['', Validators.compose([Validators.required, Validators.minLength(4)])], + username: ['', Validators.compose([Validators.required, Validators.minLength(2)])], password: ['', Validators.required] }); }