mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Login - change required username characters (#1487)
* #1480 Change required username characters * Fix unit test error
This commit is contained in:
committed by
Mario Romano
parent
399b716d82
commit
10a76cc0f6
@@ -42,7 +42,7 @@ export class LoginDemoComponent implements OnInit {
|
|||||||
private storage: StorageService,
|
private storage: StorageService,
|
||||||
private logService: LogService) {
|
private logService: LogService) {
|
||||||
this.customValidation = {
|
this.customValidation = {
|
||||||
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
|
username: ['', Validators.compose([Validators.required, Validators.minLength(2)])],
|
||||||
password: ['', Validators.required]
|
password: ['', Validators.required]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -98,8 +98,8 @@ describe('AlfrescoLogin', () => {
|
|||||||
expect(element.querySelector('#username-error').innerText).toEqual('LOGIN.MESSAGES.USERNAME-MIN');
|
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', () => {
|
it('should render validation min-length error when the username is lower than 2 characters', () => {
|
||||||
usernameInput.value = '123';
|
usernameInput.value = '1';
|
||||||
usernameInput.dispatchEvent(new Event('input'));
|
usernameInput.dispatchEvent(new Event('input'));
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
@@ -262,7 +262,7 @@ export class AlfrescoLoginComponent implements OnInit {
|
|||||||
|
|
||||||
private initFormFieldsDefault() {
|
private initFormFieldsDefault() {
|
||||||
this.form = this._fb.group({
|
this.form = this._fb.group({
|
||||||
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
|
username: ['', Validators.compose([Validators.required, Validators.minLength(2)])],
|
||||||
password: ['', Validators.required]
|
password: ['', Validators.required]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user