trim username onBlur #1575 (#1644)

This commit is contained in:
Eugenio Romano
2017-02-21 18:25:17 +00:00
committed by Mario Romano
parent 866c3f91a1
commit 2a257f7b62
3 changed files with 23 additions and 4 deletions

View File

@@ -139,6 +139,16 @@ describe('AlfrescoLogin', () => {
expect(element.querySelector('#password-required').innerText).toEqual('LOGIN.MESSAGES.PASSWORD-REQUIRED');
});
it('should trim the username value', () => {
usernameInput.value = 'username ';
component.form.controls.password.markAsDirty();
usernameInput.dispatchEvent(new Event('blur'));
fixture.detectChanges();
expect(usernameInput.value).toEqual('username');
});
it('should render no validation errors when the username and password are filled', () => {
usernameInput.value = 'fake-username';
passwordInput.value = 'fake-password';