From 4b70bcd2002bc79362d271d138a8ed308acbfdb7 Mon Sep 17 00:00:00 2001 From: ghetolay Date: Thu, 18 Jan 2018 23:58:03 +0100 Subject: [PATCH] test(forms): Better description and coverage for #19256 (#21652) fixes #21575 PR Close #21652 --- packages/forms/test/validators_spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/forms/test/validators_spec.ts b/packages/forms/test/validators_spec.ts index a30c4430be..dc750534ef 100644 --- a/packages/forms/test/validators_spec.ts +++ b/packages/forms/test/validators_spec.ts @@ -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()); });