mirror of
https://github.com/nasa/openmct.git
synced 2025-03-12 15:34:36 +00:00
[Representation] Update specs
...to verify that both mct-model and ng-model are used.
This commit is contained in:
parent
70e11d66e1
commit
b5fb2176e9
@ -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
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
@ -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
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user