feat(forms): handle string with and without line boundary on pattern validator (#19256)

PR Close #19256
This commit is contained in:
ghetolay
2017-09-18 22:28:36 +02:00
committed by Alex Eagle
parent d6ba9f9fb4
commit 54bf179888
2 changed files with 14 additions and 1 deletions

View File

@ -270,6 +270,12 @@ import {map} from 'rxjs/operator/map';
it('should not error on "undefined" pattern',
() => expect(Validators.pattern(undefined !)(new FormControl('aaAA'))).toBeNull());
it('should work with string containing line boundary',
() => expect(Validators.pattern('^[aA]*$')(new FormControl('aaAA'))).toBeNull());
it('should work with string not containing line boundary',
() => expect(Validators.pattern('[aA]*')(new FormControl('aaAA'))).toBeNull());
});
describe('compose', () => {