[Mobile] RemoveAction

Removed console and added
navigationService (mock) to the
spec version.
This commit is contained in:
Shivam Dave 2015-07-29 11:58:53 -07:00
parent 97bf530b1d
commit 6e60088b11
2 changed files with 14 additions and 6 deletions

View File

@ -70,11 +70,9 @@ define(
}
function checkCurrentObjectNavigation(parent) {
var currParent = navigationService.getNavigation().getCapability('context').getParent()
if(currParent.getId() === parent.getId()) {
var currParent = navigationService.getNavigation().getCapability('context').getParent();
if (currParent.getId() === parent.getId()) {
navigationService.setNavigation(parent);
} else {
console.log("ALL GOOD");
}
}

View File

@ -28,6 +28,7 @@ define(
describe("The Remove action", function () {
var mockQ,
mockNavigationService,
mockDomainObject,
mockParent,
mockContext,
@ -70,7 +71,16 @@ define(
mockMutation = jasmine.createSpyObj("mutation", [ "invoke" ]);
mockPersistence = jasmine.createSpyObj("persistence", [ "persist" ]);
mockType = jasmine.createSpyObj("type", [ "hasFeature" ]);
mockNavigationService = jasmine.createSpyObj(
"navigationService",
[
"getNavigation",
"setNavigation",
"addListener",
"removeListener"
]
);
mockDomainObject.getId.andReturn("test");
mockDomainObject.getCapability.andReturn(mockContext);
mockContext.getParent.andReturn(mockParent);
@ -88,7 +98,7 @@ define(
actionContext = { domainObject: mockDomainObject };
action = new RemoveAction(mockQ, actionContext);
action = new RemoveAction(mockQ, mockNavigationService, actionContext);
});
it("only applies to objects with parents", function () {