feat(forms): add novalidate by default (#13092)

This commit is contained in:
Dzmitry Shylovich
2016-12-12 22:17:42 +03:00
committed by Victor Berchet
parent e9f307f948
commit 4c35be3e07
4 changed files with 44 additions and 1 deletions

View File

@ -71,6 +71,15 @@ export function main() {
expect(input.nativeElement.value).toEqual('loginValue');
});
it('should add novalidate by default to form', () => {
const fixture = TestBed.createComponent(FormGroupComp);
fixture.componentInstance.form = new FormGroup({'login': new FormControl('loginValue')});
fixture.detectChanges();
const form = fixture.debugElement.query(By.css('form'));
expect(form.nativeElement.getAttribute('novalidate')).toEqual('');
});
it('work with formGroups (view -> model)', () => {
const fixture = TestBed.createComponent(FormGroupComp);
const form = new FormGroup({'login': new FormControl('oldValue')});