mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 22:50:49 +00:00
[Mobile] Tests
Test created for backArrow that spies on all objects used to find parent.
This commit is contained in:
parent
a073ef69ac
commit
356fa73c91
@ -249,6 +249,39 @@ define(
|
|||||||
// lets the html code know the back
|
// lets the html code know the back
|
||||||
// arrow navigation needs to be done
|
// arrow navigation needs to be done
|
||||||
it("calls the backArrow function", function () {
|
it("calls the backArrow function", function () {
|
||||||
|
var mockContext = jasmine.createSpyObj('context', ['getParent']),
|
||||||
|
mockParent = jasmine.createSpyObj(
|
||||||
|
"domainObject",
|
||||||
|
[ "getId", "getCapability", "getModel", "useCapability" ]
|
||||||
|
);
|
||||||
|
mockNavigationService = jasmine.createSpyObj(
|
||||||
|
"navigationService",
|
||||||
|
[
|
||||||
|
"getNavigation",
|
||||||
|
"setNavigation",
|
||||||
|
"addListener",
|
||||||
|
"removeListener"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
mockRoute.current.params.ids = "mine/junk";
|
||||||
|
mockParent.getId.andReturn("mine");
|
||||||
|
|
||||||
|
mockDomainObject.getCapability.andCallFake(function (c) {
|
||||||
|
return c === 'context' && mockContext;
|
||||||
|
});
|
||||||
|
|
||||||
|
mockNavigationService.getNavigation.andReturn(mockDomainObject);
|
||||||
|
mockContext.getParent.andReturn(mockParent);
|
||||||
|
|
||||||
|
controller = new BrowseController(
|
||||||
|
mockScope,
|
||||||
|
mockRoute,
|
||||||
|
mockLocation,
|
||||||
|
mockObjectService,
|
||||||
|
mockNavigationService
|
||||||
|
);
|
||||||
|
|
||||||
mockScope.backArrow();
|
mockScope.backArrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user