fix(forms): introduce checkbox required validator
Closes #11459 Closes #13364
This commit is contained in:

committed by
Victor Berchet

parent
7b0a86718c
commit
2bf1bbc071
@ -50,6 +50,14 @@ export function main() {
|
||||
() => { expect(Validators.required(new FormControl(0))).toBeNull(); });
|
||||
});
|
||||
|
||||
describe('requiredTrue', () => {
|
||||
it('should error on false',
|
||||
() => expect(Validators.requiredTrue(new FormControl(false))).toEqual({'required': true}));
|
||||
|
||||
it('should not error on true',
|
||||
() => expect(Validators.requiredTrue(new FormControl(true))).toBeNull());
|
||||
});
|
||||
|
||||
describe('minLength', () => {
|
||||
it('should not error on an empty string',
|
||||
() => { expect(Validators.minLength(2)(new FormControl(''))).toBeNull(); });
|
||||
|
Reference in New Issue
Block a user