#567 Login Component should emit object not strings

This commit is contained in:
Mario Romano
2016-08-12 17:09:39 +01:00
parent 100cd73ca8
commit 7c54df1333
2 changed files with 4 additions and 8 deletions

View File

@@ -348,7 +348,7 @@ describe('AlfrescoLogin', () => {
expect(component.success).toBe(true);
expect(compiled.querySelector('#login-success')).toBeDefined();
expect(compiled.querySelector('#login-success').innerHTML).toEqual('LOGIN.MESSAGES.LOGIN-SUCCESS');
expect(component.onSuccess.emit).toHaveBeenCalledWith({value: 'Login OK'});
expect(component.onSuccess.emit).toHaveBeenCalledWith(true);
});
it('should emit onError event after the login has failed', () => {
@@ -379,7 +379,7 @@ describe('AlfrescoLogin', () => {
expect(component.success).toBe(false);
expect(compiled.querySelector('#login-error')).toBeDefined();
expect(compiled.querySelector('#login-error').innerText).toEqual('LOGIN.MESSAGES.LOGIN-ERROR');
expect(component.onError.emit).toHaveBeenCalledWith({value: 'Login KO'});
expect(component.onError.emit).toHaveBeenCalledWith('Fake server error');
});
it('should render the password in clear when the toggleShowPassword is call', () => {