diff --git a/platform/representation/test/MCTIncludeSpec.js b/platform/representation/test/MCTIncludeSpec.js index bce138a9bb..27b134adcb 100644 --- a/platform/representation/test/MCTIncludeSpec.js +++ b/platform/representation/test/MCTIncludeSpec.js @@ -78,7 +78,11 @@ define( return testUrls[template.key]; }); mctInclude = new MCTInclude(testTemplates, mockLinker); - testAttrs = { key: "parentKey" }; + testAttrs = { + key: "parentKey", + mctModel: "someExpr", + ngModel: "someOtherExpr" + }; mctInclude.link(mockScope, mockElement, testAttrs); }); @@ -101,6 +105,19 @@ define( .toHaveBeenCalledWith(testUrls.xyz); }); + it("watches for changes on both ng-model and mct-model", function () { + expect(mockScope.$parent.$watch).toHaveBeenCalledWith( + testAttrs.ngModel, + jasmine.any(Function), + false + ); + expect(mockScope.$parent.$watch).toHaveBeenCalledWith( + testAttrs.mctModel, + jasmine.any(Function), + false + ); + }); + }); } ); diff --git a/platform/representation/test/MCTRepresentationSpec.js b/platform/representation/test/MCTRepresentationSpec.js index eea4d6e1a5..4d424b01cb 100644 --- a/platform/representation/test/MCTRepresentationSpec.js +++ b/platform/representation/test/MCTRepresentationSpec.js @@ -105,7 +105,9 @@ define( testAttrs = { "mctObject": "someExpr", - "key": "someOtherExpr" + "key": "someOtherExpr", + "ngModel": "yetAnotherExpr", + "mctModel": "theExprsKeepOnComing" }; mockRepresenters = ["A", "B"].map(function (name) { @@ -229,6 +231,19 @@ define( expect(mockScope.testCapability).toBeUndefined(); }); + + it("watches for changes on both ng-model and mct-model", function () { + expect(mockScope.$parent.$watch).toHaveBeenCalledWith( + testAttrs.ngModel, + jasmine.any(Function), + false + ); + expect(mockScope.$parent.$watch).toHaveBeenCalledWith( + testAttrs.mctModel, + jasmine.any(Function), + false + ); + }); }); } );