Skip to content

Commit 28db864

Browse files
committed
cleanup(forms): add missing tests
1 parent 28d88c5 commit 28db864

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

modules/angular2/test/core/forms/model_spec.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,24 @@ export function main() {
488488
a = new ControlArray([c]);
489489
});
490490

491-
it("should be false after creating a control", () => { expect(a.pending).toEqual(false); });
491+
it("should be false after creating a control", () => {
492+
expect(c.pending).toEqual(false);
493+
expect(a.pending).toEqual(false);
494+
});
492495

493-
it("should be false after changing the value of the control", () => {
496+
it("should be true after changing the value of the control", () => {
494497
c.markAsPending();
495498

499+
expect(c.pending).toEqual(true);
496500
expect(a.pending).toEqual(true);
497501
});
502+
503+
it("should not update the parent when onlySelf = true", () => {
504+
c.markAsPending({onlySelf: true});
505+
506+
expect(c.pending).toEqual(true);
507+
expect(a.pending).toEqual(false);
508+
});
498509
});
499510

500511
describe("valueChanges", () => {

0 commit comments

Comments
 (0)