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",
|
"key": "mutation",
|
||||||
"implementation": "capabilities/MutationCapability.js",
|
"implementation": "capabilities/MutationCapability.js",
|
||||||
"depends": [ "now" ]
|
"depends": [ "topic", "now" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "delegation",
|
"key": "delegation",
|
||||||
@ -202,4 +202,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ define(
|
|||||||
* which will expose this capability
|
* which will expose this capability
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function MutationCapability(now, domainObject) {
|
function MutationCapability(topic, now, domainObject) {
|
||||||
var listeners = [];
|
var listeners = [];
|
||||||
|
|
||||||
function notifyListeners(model) {
|
function notifyListeners(model) {
|
||||||
|
@ -25,21 +25,30 @@
|
|||||||
* MutationCapabilitySpec. Created by vwoeltje on 11/6/14.
|
* MutationCapabilitySpec. Created by vwoeltje on 11/6/14.
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
["../../src/capabilities/MutationCapability"],
|
[
|
||||||
function (MutationCapability) {
|
"../../src/capabilities/MutationCapability",
|
||||||
|
"../../src/services/Topic"
|
||||||
|
],
|
||||||
|
function (MutationCapability, Topic) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
describe("The mutation capability", function () {
|
describe("The mutation capability", function () {
|
||||||
var testModel,
|
var testModel,
|
||||||
|
topic,
|
||||||
mockNow,
|
mockNow,
|
||||||
domainObject = { getModel: function () { return testModel; } },
|
domainObject = { getModel: function () { return testModel; } },
|
||||||
mutation;
|
mutation;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
testModel = { number: 6 };
|
testModel = { number: 6 };
|
||||||
|
topic = new Topic();
|
||||||
mockNow = jasmine.createSpy('now');
|
mockNow = jasmine.createSpy('now');
|
||||||
mockNow.andReturn(12321);
|
mockNow.andReturn(12321);
|
||||||
mutation = new MutationCapability(mockNow, domainObject);
|
mutation = new MutationCapability(
|
||||||
|
topic,
|
||||||
|
mockNow,
|
||||||
|
domainObject
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows mutation of a model", function () {
|
it("allows mutation of a model", function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user