mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
[Mobile] RemoveAction
Removed console and added navigationService (mock) to the spec version.
This commit is contained in:
parent
97bf530b1d
commit
6e60088b11
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user