cleanup(forms): add missing tests

This commit is contained in:
vsavkin 2015-10-26 11:50:30 -07:00
parent 28d88c5b12
commit 28db864690
1 changed files with 13 additions and 2 deletions

View File

@ -488,13 +488,24 @@ export function main() {
a = new ControlArray([c]); a = new ControlArray([c]);
}); });
it("should be false after creating a control", () => { expect(a.pending).toEqual(false); }); it("should be false after creating a control", () => {
expect(c.pending).toEqual(false);
expect(a.pending).toEqual(false);
});
it("should be false after changing the value of the control", () => { it("should be true after changing the value of the control", () => {
c.markAsPending(); c.markAsPending();
expect(c.pending).toEqual(true);
expect(a.pending).toEqual(true); expect(a.pending).toEqual(true);
}); });
it("should not update the parent when onlySelf = true", () => {
c.markAsPending({onlySelf: true});
expect(c.pending).toEqual(true);
expect(a.pending).toEqual(false);
});
}); });
describe("valueChanges", () => { describe("valueChanges", () => {