mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
[Core] Add dependency to mutation
Add the 'topic' dependency to the mutation capability, WTD-1329.
This commit is contained in:
parent
1a6d92ee4e
commit
877461c4a4
@ -172,7 +172,7 @@
|
||||
{
|
||||
"key": "mutation",
|
||||
"implementation": "capabilities/MutationCapability.js",
|
||||
"depends": [ "now" ]
|
||||
"depends": [ "topic", "now" ]
|
||||
},
|
||||
{
|
||||
"key": "delegation",
|
||||
@ -202,4 +202,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ define(
|
||||
* which will expose this capability
|
||||
* @constructor
|
||||
*/
|
||||
function MutationCapability(now, domainObject) {
|
||||
function MutationCapability(topic, now, domainObject) {
|
||||
var listeners = [];
|
||||
|
||||
function notifyListeners(model) {
|
||||
|
@ -25,21 +25,30 @@
|
||||
* MutationCapabilitySpec. Created by vwoeltje on 11/6/14.
|
||||
*/
|
||||
define(
|
||||
["../../src/capabilities/MutationCapability"],
|
||||
function (MutationCapability) {
|
||||
[
|
||||
"../../src/capabilities/MutationCapability",
|
||||
"../../src/services/Topic"
|
||||
],
|
||||
function (MutationCapability, Topic) {
|
||||
"use strict";
|
||||
|
||||
describe("The mutation capability", function () {
|
||||
var testModel,
|
||||
topic,
|
||||
mockNow,
|
||||
domainObject = { getModel: function () { return testModel; } },
|
||||
mutation;
|
||||
|
||||
beforeEach(function () {
|
||||
testModel = { number: 6 };
|
||||
topic = new Topic();
|
||||
mockNow = jasmine.createSpy('now');
|
||||
mockNow.andReturn(12321);
|
||||
mutation = new MutationCapability(mockNow, domainObject);
|
||||
mutation = new MutationCapability(
|
||||
topic,
|
||||
mockNow,
|
||||
domainObject
|
||||
);
|
||||
});
|
||||
|
||||
it("allows mutation of a model", function () {
|
||||
|
Loading…
Reference in New Issue
Block a user