autocomplete off (#2938)

This commit is contained in:
Eugenio Romano 2018-02-13 15:57:58 +00:00 committed by Vito
parent c5225a4c7d
commit a014aef9e0
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<div class="ie11FixerChild">
<mat-card class="adf-login-card-wide">
<form [formGroup]="form" (submit)="onSubmit(form.value)">
<form id="adf-login-form" [formGroup]="form" (submit)="onSubmit(form.value)" autocomplete="off">
<mat-card-header>
<mat-card-title>
@ -81,7 +81,7 @@
[class.isChecking]="actualLoginStep === LoginSteps.Checking"
[class.isWelcome]="actualLoginStep === LoginSteps.Welcome"
data-automation-id="login-button" [disabled]="!form.valid">
<span *ngIf="actualLoginStep === LoginSteps.Landing" class="adf-login-button-label">{{ 'LOGIN.BUTTON.LOGIN' | translate }}</span>
<div *ngIf="actualLoginStep === LoginSteps.Checking" class="adf-interactive-login-label">

View File

@ -100,6 +100,10 @@ describe('LoginComponent', () => {
fixture.detectChanges();
}
it('should be autocompelte off', () => {
expect(element.querySelector('#adf-login-form').getAttribute('autocomplete')).toBe('off');
});
it('should redirect to route on successful login', () => {
spyOn(authService, 'login').and.returnValue(Observable.of({ type: 'type', ticket: 'ticket'}));
const redirect = '/home';