diff --git a/platform/entanglement/src/services/MoveService.js b/platform/entanglement/src/services/MoveService.js index 9dc8b80169..e6e1238979 100644 --- a/platform/entanglement/src/services/MoveService.js +++ b/platform/entanglement/src/services/MoveService.js @@ -75,7 +75,7 @@ define( oldLocationCapability = object .getCapability('location'); if (!newLocationCapability || - oldLocationCapability) { + !oldLocationCapability) { return; } diff --git a/platform/entanglement/test/services/MoveServiceSpec.js b/platform/entanglement/test/services/MoveServiceSpec.js index fed7878ac7..02494a0afb 100644 --- a/platform/entanglement/test/services/MoveServiceSpec.js +++ b/platform/entanglement/test/services/MoveServiceSpec.js @@ -162,7 +162,8 @@ define( 'locationCapability', [ 'isOriginal', - 'setPrimaryLocation' + 'setPrimaryLocation', + 'getContextualLocation' ] ); @@ -195,13 +196,15 @@ define( describe("when moving an original", function () { beforeEach(function () { + locationCapability.getContextualLocation + .andReturn('new-location'); locationCapability.isOriginal.andReturn(true); linkService.perform.mostRecentCall.promise.resolve(); }); it("updates location", function () { expect(locationCapability.setPrimaryLocation) - .toHaveBeenCalled(); + .toHaveBeenCalledWith('new-location'); }); describe("after location update", function () {