From 877461c4a4f27aaa4a3bd5171a1aa174b3383df5 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 24 Jun 2015 12:08:47 -0700 Subject: [PATCH] [Core] Add dependency to mutation Add the 'topic' dependency to the mutation capability, WTD-1329. --- platform/core/bundle.json | 4 ++-- .../core/src/capabilities/MutationCapability.js | 2 +- .../test/capabilities/MutationCapabilitySpec.js | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/platform/core/bundle.json b/platform/core/bundle.json index 245fc3df72..c4d46511a5 100644 --- a/platform/core/bundle.json +++ b/platform/core/bundle.json @@ -172,7 +172,7 @@ { "key": "mutation", "implementation": "capabilities/MutationCapability.js", - "depends": [ "now" ] + "depends": [ "topic", "now" ] }, { "key": "delegation", @@ -202,4 +202,4 @@ } ] } -} \ No newline at end of file +} diff --git a/platform/core/src/capabilities/MutationCapability.js b/platform/core/src/capabilities/MutationCapability.js index 11f3973e19..a7684e61c2 100644 --- a/platform/core/src/capabilities/MutationCapability.js +++ b/platform/core/src/capabilities/MutationCapability.js @@ -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) { diff --git a/platform/core/test/capabilities/MutationCapabilitySpec.js b/platform/core/test/capabilities/MutationCapabilitySpec.js index 99dd3a74c1..750bf05e48 100644 --- a/platform/core/test/capabilities/MutationCapabilitySpec.js +++ b/platform/core/test/capabilities/MutationCapabilitySpec.js @@ -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 () {