test(forms): Better description and coverage for #19256 (#21652)

fixes #21575

PR Close #21652
This commit is contained in:
ghetolay 2018-01-18 23:58:03 +01:00 committed by Miško Hevery
parent 8baff1858b
commit 4b70bcd200
1 changed files with 8 additions and 2 deletions

View File

@ -271,10 +271,16 @@ 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',
it('should work with pattern string containing both boundary symbols',
() => expect(Validators.pattern('^[aA]*$')(new FormControl('aaAA'))).toBeNull());
it('should work with string not containing line boundary',
it('should work with pattern string containing only start boundary symbols',
() => expect(Validators.pattern('^[aA]*')(new FormControl('aaAA'))).toBeNull());
it('should work with pattern string containing only end boundary symbols',
() => expect(Validators.pattern('[aA]*$')(new FormControl('aaAA'))).toBeNull());
it('should work with pattern string not containing any boundary symbols',
() => expect(Validators.pattern('[aA]*')(new FormControl('aaAA'))).toBeNull());
});