fix(forms): update compose to handle null validators

This commit is contained in:
vsavkin
2015-10-29 17:45:24 -07:00
committed by Victor Savkin
parent bb2b961f93
commit 9d58f46ea5
2 changed files with 7 additions and 3 deletions

View File

@ -82,6 +82,11 @@ export function main() {
var c = Validators.compose([Validators.nullValidator, Validators.nullValidator]);
expect(c(new Control(""))).toEqual(null);
});
it("should ignore nulls", () => {
var c = Validators.compose([null, Validators.required]);
expect(c(new Control(""))).toEqual({"required": true});
});
});
});
}