fix(forms): default the initial value of Control to null

This commit is contained in:
vsavkin
2015-07-16 18:34:03 -07:00
parent 4d28167bc0
commit 5b597de18c
4 changed files with 9 additions and 3 deletions
@@ -19,6 +19,12 @@ import {ObservableWrapper} from 'angular2/src/facade/async';
export function main() {
describe("Form Model", () => {
describe("Control", () => {
it("should default the value to null", () => {
var c = new Control();
expect(c.value).toBe(null);
expect(c.validator).toBe(Validators.nullValidator);
});
describe("validator", () => {
it("should run validator with the initial value", () => {
var c = new Control("value", Validators.required);